node-jsonwebtoken
v0.0.1
Published
JsonWebToken implementation for node.js
Downloads
7,250
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);