jwt-lite
isomorphic library to decode, sign, and verify JSON Web Tokens
Last updated a year ago by kevlened .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install jwt-lite 
SYNC missed versions from official npm registry.

jwt-lite

Install

npm install jwt-lite

Usage

const jwt = require('jwt-lite')

const decoded = jwt.decode('somejwt');
const {
  header,         // jose header
  claimsSet,      // claimsSet as a JSON object
  signedContent,  // UintArray of the signed content
  signature       // UintArray of the signature
} = decoded;

jwt.sign(payload, jwk)
.then(jwtToken => console.log(jwtToken))

jwt.verify(jwtToken, jwk)
.then(payload => console.log(payload))

Can it be smaller?

If you use ES6 imports with a bundler that supports tree-shaking, yes!

import { sign } from 'jwt-lite'

License

MIT

Current Tags

  • 2.1.0                                ...           latest (a year ago)

9 Versions

  • 2.1.0                                ...           a year ago
  • 2.0.0                                ...           a year ago
  • 1.1.4                                ...           a year ago
  • 1.1.3                                ...           a year ago
  • 1.1.2                                ...           2 years ago
  • 1.1.1                                ...           3 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
  • 0.0.1                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (9)

Copyright 2014 - 2016 © taobao.org |