Package Exports
- jwt-then
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jwt-then) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
jwt-then
jwt as promised
$ npm install jwt-then
API
Tested for node 4+ with two implemented methods only, verify and sign.
Consult auth0/node-jsonwebtoken#README for detailed documentation.
jwt.sign(payload, key, [options])
Sign a token with key, with options defaulting to { algorithm: 'HS256' }.
jwt.sign({ username: 'fl0w' }, 'secret-dev-key')
.then(token => console.log(token))Marty McFly's: ES7 (or using Present MacFly's babel.js)
const token = await jwt.sign({ username: 'fl0w', 'secret-dev-key'})
console.log(token)jwt.verify(token, key, [options])
Verify a token, with options defaulting to { algorithm: 'HS256' }.
jwt.verify(token, 'secret-dev-key')
.then(token => console.log(token))Marty McFly's: ES7 (or using Present MacFly's babel.js)
const token = await jwt.verify({ username: 'fl0w', 'secret-dev-key'})
console.log(token)