JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 639
  • Score
    100M100P100Q95626F
  • License MIT

OTP(One-Time-Password) generator for JavaScript

Package Exports

  • otp-agent

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (otp-agent) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

OTP-Agent CI status

OTP(One-Time-Password) generator for JavaScript

Installation

This is a Node.js module available through the npm registry.
Installation is done using the npm install command:

$ npm install otp-agent

Example & Usage

const otpAgent = require('otp-agent');

const otpLength = 6;
var otp = otpAgent.generateOTP(otpLength);
console.log(otp);

otp = otpAgent.generateOTP(otpLength, { numbers: true });
console.log(otp);

otp = otpAgent.generateOTP(otpLength, { numbers: true, alphabets: true, upperCaseAlphabets: true, specialChars: true });
console.log(otp);

Note

  • Can be used to generate OTP using numbers, alphabets, upperCaseAlphabets, special characters and have option to choose either one of them.
  • By default all options are true if any options are not provided.

Author

Rohan Shukla GitHub LinkedIn

License

© Licensed under the MIT License.