Neurotic and Probably Misinformed

npm

npm’s 2019 JavaScript ecosystem survey analysis is now available! Get your copy here »

jwt-lite

1.1.2 • Public • Published

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

Keywords

none

install

npm i jwt-lite

Downloadsweekly downloads

19

version

1.1.2

license

MIT

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability