diff --git a/README.md b/README.md index da35fa5..d76f879 100644 --- a/README.md +++ b/README.md @@ -231,6 +231,9 @@ jwt.verify(token, getKey, options, function(err, decoded) { ``` +
+Need to peak into a JWT without verifying it? (Click to expand) + ### jwt.decode(token [, options]) (Synchronous) Returns the decoded payload without verifying if the signature is valid. @@ -259,6 +262,8 @@ console.log(decoded.header); console.log(decoded.payload) ``` +
+ ## Errors & Codes Possible thrown errors during verification. Error is the first argument of the verification callback. diff --git a/index.js b/index.js index 161eb2d..a480f1d 100644 --- a/index.js +++ b/index.js @@ -1,8 +1,12 @@ module.exports = { - decode: require('./decode'), verify: require('./verify'), sign: require('./sign'), JsonWebTokenError: require('./lib/JsonWebTokenError'), NotBeforeError: require('./lib/NotBeforeError'), TokenExpiredError: require('./lib/TokenExpiredError'), }; + +Object.defineProperty(module.exports, 'decode', { + enumerable: false, + value: require('./decode'), +});