A simple JavaScript utilty library to generate random pin codes.
$ yarn add pin-generator
# or
$ npm install pin-generator
import generatePin from "pin-generator";
generatePin(); // returns a 4-digit pin
You can also specify the number of digits you want by calling the generatePin
method
with an argument
generatePin(6); // 6-digit pin
MIT © Eyuel Berga