Skip to content

lagden/jwt

Repository files navigation

JWT

NPM version Build Status Coverage Status FOSSA Status


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

FOSSA Status