1.0.4 • Published 4 years ago

otp-agent v1.0.4

Weekly downloads
33
License
MIT
Repository
github
Last release
4 years ago

OTP-Agent NPM Version CI status Total Download

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.
  • otpLength - length of OTP, default length is 10 and OTP length cannot be more than 10 characters.
  • By default all options are true if any options are not provided.

Author

Rohan Shukla GitHub LinkedIn

License

© Licensed under the MIT License.