Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

node-jsonwebtoken

nur8405.6kMIT0.0.1TypeScript support: included

JsonWebToken implementation for node.js

jwt

readme

node-jwt

It provide a nice (api) way to use jsonwebtoken;

JWT

import { JWT } from "node-jsonwebtoken";

interface Payload {
    id: number,
    name: string,
}
const jwt = new JWT<Payload>('secret_key');

const token = await jwt.sign({ id: 1, name: "Alex" });
const payload = await jwt.verify(token);