@yash112/jwt-library
Version:
Encode, Decode & Validate JSON Web Token (JWTs)
8 lines (7 loc) • 321 B
TypeScript
export declare function encode_jwt(secret: string, id: string | number, payload: object, ttl?: number): string;
export declare function decode_jwt(secret: string, token: string): {
id: string;
payload: object;
expires_at: Date;
};
export declare function validate_jwt(secret: string, token: string): boolean;