Skip to content

Commit 8d5253c

Browse files
committed
feat: add the version of the tool
1 parent 77bc7b9 commit 8d5253c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ import chalk from 'chalk';
44
import Debug from 'debug';
55
import JWT from './src/index.js';
66
import { Render } from './src/table.js';
7+
import pkg from './package.json' assert { type: 'json' }
78

89
global.debug = Debug('hwt')
910

1011
try {
1112
program
13+
.version(pkg.version, '-v, --version', 'output the current version')
1214
.option('--raw')
1315
.option('-c, --claims <claims>')
1416
.hook('preAction', (command, actionCommand) => {

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
2-
"name": "simple-jwt",
2+
"name": "hwt",
33
"version": "0.0.1",
4-
"description": "A human friendly JWT inspector for your terminal. ",
4+
"description": "A human friendly JWT inspector for your terminal.",
55
"type": "module",
66
"main": "index.js",
77
"scripts": {
8+
"start": "node --experimental-json-modules index.js",
89
"prebuild": "esbuild index.js --inject:./scripts/import-meta-url.build.js --define:import.meta.url=import_meta_url --sourcemap --bundle --platform=node --outfile=dist/hwt.cjs",
910
"build": "pkg --out-path dist --compress GZip dist/hwt.cjs ",
1011
"postbuild": "tar -cvzf dist/hwt.tar.gz dist/hwt-*",

0 commit comments

Comments
 (0)