@clarketm/jwt-cli
v1.2.0
Published
Command line tool for working with JSON Web Tokens (JWT)
Downloads
249
Maintainers
Readme
jwt-cli
Command line tool for working with JSON Web Tokens (JWT).
Installation
Yarn
yarn global add "@clarketm/jwt-cli"
Npm
npm install --global "@clarketm/jwt-cli"
Demo
Usage
sign [options] payload secret
$ jwt sign '{"user": "Travis Clarke"}' "super secret"
copied to clipboard:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhIjoxLCJpYXQiOjE1MjczMTI3NTIsImV4cCI6MTUyNzMxNjM1Mn0.2l4wyaoxNBBY7nvm6sAqAcmXSuuKjBubNo_h42hcigU
Note: the
sign
subcommand accepts all the same options asauth0/node-jsonwebtoken
with the exception ofmutatePayload
which is not applicable.
| Option | Description |
| ------------------ | --------------------------------------------------- |
| -n, --noCopy
| Do not copy the token to the clipboard. |
| -p, --passphrase
| The passphrase for your secret (if it is encrypted) |
verify [options] token secret
$ jwt verify "eyJhbGciOiJIUzI1..." "super secret"
valid!
Note: the
verify
subcommand accepts all the same options asauth0/node-jsonwebtoken
decode [options] token
$ jwt decode "eyJhbGciOiJIUzI1..."
copied to clipboard:
{
user: 'Travis Clarke',
iat: 1537507542,
exp: 1537511142
}
Note: the
decode
subcommand accepts all the same options asauth0/node-jsonwebtoken
with the exception ofjson
which is not applicable.
| Option | Description |
| -------------- | ----------------------------------------- |
| -n, --noCopy
| Do not copy the payload to the clipboard. |
Related
- node-jsonwebtoken – JsonWebToken implementation for node.js
License
MIT © Travis Clarke