jwt as promised
$ npm install jwt-then
Tested for node 4+
with two implemented methods only, verify
and sign
.
Consult auth0/node-jsonwebtoken#README for detailed documentation.
Sign a token with key, with options defaulting to { algorithm: 'HS256' }
.
ES6:
jwt.sign({ username: 'fl0w' }, 'secret-dev-key').then(console.log)
ES7:
const token = await jwt.sign({ username: 'fl0w' }, 'secret-dev-key')
console.log(token)
Verify a token, with options defaulting to { algorithm: 'HS256' }
.
ES6:
jwt.verify(token, 'secret-dev-key')
.then(console.log)
ES7:
const result = await jwt.verify(token, 'secret-dev-key')
console.log(result)
- Bump release
- Upgrade dependency jsonwebtoken min to 8.3
- Upgrade devDependencies mocha and standard
- Removed dependency
any-promise
- Passing opts to jsonwebtoken
- Travis testing fixes
- Added .editorconfig, because vim goes haywire without it
- Added standard linter
- Fixed some weirdness in README
- Bumped dependency to jsonwebtoken@7 (major)