@tadashi/jwt
v8.7.0
Published
Sign, verify and parse a JSON Web Token
Downloads
128
Readme
JWT
Sign, verify and parse a JSON Web Token
Install
$ npm i -S @tadashi/jwt
Usage
import {sign, verify, parse} from '@tadashi/jwt'
const jwt = await sign({name: 'Lucas Tadashi'})
// => eyJhbGciOiJIUz...
const {payload} = await verify(jwt)
// => {data: {name: 'Lucas Tadashi'}, jti: '6125968b0000000000f0b9f2', nbf: 1629853313}
const {
data: {name},
} = parse(jwt)
// => Lucas Tadashi
License
MIT © Thiago Lagden