1.0.0 • Published 2 years ago

jwt-token-utility v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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

Davic64

Licence

This project is licensed under the MIT license. See the LICENSE file for more info.