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

1.2.0 • Public • Published

jwt-lite

Install

npm install @egendata/jwt-lite

Usage

const jwt = require('@egendata/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 '@egendata/jwt-lite'

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @egendata/jwt-lite

Weekly Downloads

2

Version

1.2.0

License

MIT

Unpacked Size

7.26 kB

Total Files

5

Last publish

Collaborators

  • graborg
  • ersti
  • egendata-dev
  • raduachim