1.0.0 • Published 2 years ago
jwt-token-utility v1.0.0
JWT Token Utility
It is a utility that seeks to save a few lines of code when generating a token and decoding it using jsonwebtoken.
Install
$ npm install jwt-token-utility
Usage
For create a token
import { createToken } from "jwt-token-utility";
const token = createToken({ id: 2, name: "user" }, "SECRET_KEY", "2d");
For verify token
import { verifyToken } from "jwt-token-utility";
try {
verifyToken("TOKEN", "SECRET_KEY");
} catch (err) {
console.log(err.message);
}
Author
Licence
This project is licensed under the MIT license. See the LICENSE file for more info.
1.0.0
2 years ago