JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 209
  • Score
    100M100P100Q82629F
  • License MIT

jwt as promised

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

Build statusLicense

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' }.

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)

jwt.verify(token, key, [options])

Verify a token, with options defaulting to { algorithm: 'HS256' }.

ES6:

jwt.verify(token, 'secret-dev-key')
  .then(console.log)

ES7:

const token = await jwt.verify({ username: 'fl0w' }, 'secret-dev-key')
console.log(token)

Changelog

1.0.1 (2018-06-26)

  • Bump release

1.0.0 (2018-06-26)

  • Upgrade dependency jsonwebtoken min to 8.3
  • Upgrade devDependencies mocha and standard

0.6.0 (2016-11-22)

  • Removed dependency any-promise

0.5.1 (2016-07-06)

  • Passing opts to jsonwebtoken
  • Travis testing fixes

0.4.1

  • Added .editorconfig, because vim goes haywire without it
  • Added standard linter
  • Fixed some weirdness in README

0.4.0

  • Bumped dependency to jsonwebtoken@7 (major)