Skip to content

Instantly share code, notes, and snippets.

@davidbarral
Created January 20, 2018 15:57
Show Gist options
  • Save davidbarral/23f84102a3bf542a013b269740ada10a to your computer and use it in GitHub Desktop.
Save davidbarral/23f84102a3bf542a013b269740ada10a to your computer and use it in GitHub Desktop.
Promisify: node promisify
const { promisify } = require("util");
const jwt = require("jsonwebtoken");
const jwtVerify = promisify(jwt.verify);
const verifyToken = token => jwtVerify(token, CERTIFICATE, { algorithms: ["RS256"] });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment