jwtcli
v1.0.0-beta.1
Published
cli wrapper around jsonwebtoken
Downloads
4
Readme
jwtcli
a node.js
based CLI wrapper around jsonwebtoken
Installing
via npm:
$ npm install -g jwtcli
$ jwt --version
Getting Started
sign
Help
$ jwt sign --help
jwt sign [claims]
Options:
--version Show version number [boolean]
-h Show help [boolean]
-a, --algorithm signing algorithm
[string] [choices: "RS256", "RS384", "RS512", "ES256", "ES384", "ES512",
"HS256", "HS384", "HS512", "none"] [default: "HS256"]
--audience value of "aud" claim [string]
-e, --expires-in timestring used to calculate token ttl [string]
--header custom header JSON [string]
-i, --issuer value of "iss" claim [string]
--jwtid value of "jwtid" claim [string]
--keyid value of "keyid" claim [string]
-n, --not-before timestring used to calculate "nbf" claim [string]
--timestamp include "iat" header, can be disabled with --no-timestamp
[boolean] [default: true]
-s, --secret JWT signing secret [string] [required]
--subject value of "sub" claim [string]
Example
$ jwt sign -s SECRET -e 30m -i abc '{"foo":"bar"}'
Todo
- [x] sign
- [ ] decode
- [ ] verify
Testing
run the test suite
npm test
run coverage
npm run coverage
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
License
Copyright (c) 2017 Chris Ludden.
Licensed under the MIT license.