Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@abskmj/jwt-utility

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@abskmj/jwt-utility - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

2

package.json
{
"name": "@abskmj/jwt-utility",
"version": "0.0.2",
"version": "0.0.3",
"description": "JWT Utility for Node.js",

@@ -5,0 +5,0 @@ "keywords": [

@@ -10,3 +10,3 @@ # JWT Utility for Node.js

# Utlity Methods
# Utility Methods
| Method | Arguments | Description |

@@ -50,5 +50,24 @@ | :--- | :--- | :--- |

.parse(jwt, 'secret key');
/*
data:
{
headers: {
alg: 'HS256',
typ: 'JWT'
},
claims: {
user: 'testUser',
name: 'Test User',
iat: 1512555172,
iss: 'AuthServer',
sub: 'Login',
exp: 1512555182
}
}
*/
```
## Factory Instance Methods
## Parser Instance Methods
| Method | Arguments | Description |

@@ -61,1 +80,4 @@ | :--- | :--- | :--- |

| `parse` | String, String | Set JWT token and key used to verify the token |
# Further Development
Support for RS256, RS384, RS512 is not planned yet. Please get in touch with the [developer](mailto:abskmj@gmail.com), if you wish to request any new functionality or bug fix.
const JWTUtility = require('./index');
let jwt = JWTUtility.getFactory('HS256')
.setIssuer('majhi')
.setIssuer('AuthServer')
.setSubject('Login')

@@ -11,3 +11,3 @@ .setExpiry(10)

})
.sign('testKy');
.sign('secret key');

@@ -17,7 +17,6 @@ console.log(jwt);

let data = JWTUtility.getParser()
.validateIssuer('majhi')
.validateExpiry(10)
.validateIssuer('AuthServer')
.validateSubject('Login')
.parse(jwt, 'testKy');
.parse(jwt, 'secret key');
console.log(data);
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc