jwt-lite
TypeScript icon, indicating that this package has built-in type declarations

2.1.0 • 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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.1.0
    27
    • latest

Version History

Package Sidebar

Install

npm i jwt-lite

Weekly Downloads

27

Version

2.1.0

License

MIT

Unpacked Size

8.22 kB

Total Files

6

Last publish

Collaborators

  • kevlened