1.0.2 • Published 4 years ago
jsonwebtoken-async v1.0.2
jsonwebtoken-async
This is simply a promise wrapper of node-jsonwebtoken from Auth0. Nothing special.
Install
$ npm install jsonwebtoken-async
Getting started:
Please check out the original repo for tutorial.
Example of signing a key
const fs = require('fs');
const jwt = require('jsonwebtoken-async');
const privateKey = fs.readFileSync('./keys/private.key');
const publicKey = fs.readFileSync('./keys/public.key');
async function sign() {
const token = await jwt.sign({ foo: 'bar' }, privateKey, {algorithm: 'RS256' });
console.log(token);
}
sign();