otp-agent

1.0.4 • Public • Published

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.

Package Sidebar

Install

npm i otp-agent

Weekly Downloads

27

Version

1.0.4

License

MIT

Unpacked Size

5.86 kB

Total Files

4

Last publish

Collaborators

  • rohanshukla