ashwin-token-generator
v1.0.1
Published
A simple package to generate JWT tokens
Downloads
24
Readme
jwt-generator
A simple Node.js package for generating JWT (JSON Web Tokens) based on given payload, secret key, and optional settings.
Installation
You can install this package using npm:
npm install jwt-generator
## Function
/**
* Generate a JWT token
* @param {Object} payload - The payload to encode in the JWT.
* @param {String} secretKey - The secret key to sign the JWT.
* @param {Object} [options] - Optional settings (e.g., expiresIn).
* @returns {String} - The generated JWT token.
*/
generateToken(payload, secretKey, options = {})