Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eyuelberga/pin-generator
Javascript library to generate random pin codes
https://github.com/eyuelberga/pin-generator
Last synced: 3 days ago
JSON representation
Javascript library to generate random pin codes
- Host: GitHub
- URL: https://github.com/eyuelberga/pin-generator
- Owner: eyuelberga
- License: mit
- Created: 2021-08-16T18:21:34.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-08-17T07:56:24.000Z (over 3 years ago)
- Last Synced: 2025-01-20T22:49:24.919Z (9 days ago)
- Language: TypeScript
- Size: 73.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pin-generator
> A simple JavaScript utilty library to generate random pin codes.
## Installation
```sh
$ yarn add pin-generator# or
$ npm install pin-generator
```## Usage
```js
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```js
generatePin(6); // 6-digit pin
```
Also see [CodeSandbox Demo](https://codesandbox.io/s/pin-generator-demo-nz841?file=/src/index.js) for a complete example## License
MIT © [Eyuel Berga](https://github.com/eyuelberga)