Socket
Socket
Sign inDemoInstall

jsonwebtoken

Package Overview
Dependencies
Maintainers
6
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonwebtoken - npm Package Compare versions

Comparing version 5.0.5 to 5.1.0

test/async_sign.tests.js

15

index.js

@@ -38,3 +38,3 @@ var jws = require('jws');

JWT.sign = function(payload, secretOrPrivateKey, options) {
JWT.sign = function(payload, secretOrPrivateKey, options, callback) {
options = options || {};

@@ -83,5 +83,12 @@

var signed = jws.sign({header: header, payload: payload, secret: secretOrPrivateKey, encoding: encoding});
return signed;
if(typeof callback === 'function') {
jws.createSign({
header: header,
payload: payload,
privateKey: secretOrPrivateKey,
payload: JSON.stringify(payload)
}).on('done', callback);
} else {
return jws.sign({header: header, payload: payload, secret: secretOrPrivateKey, encoding: encoding});
}
};

@@ -88,0 +95,0 @@

{
"name": "jsonwebtoken",
"version": "5.0.5",
"version": "5.1.0",
"description": "JSON Web Token implementation (symmetric and asymmetric)",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc