Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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)