Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cuongndc9/numcode
6️⃣7️⃣ Generating codes is easy and simple.
https://github.com/cuongndc9/numcode
103cuong code number-code numcode otp-code
Last synced: about 2 months ago
JSON representation
6️⃣7️⃣ Generating codes is easy and simple.
- Host: GitHub
- URL: https://github.com/cuongndc9/numcode
- Owner: cuongndc9
- License: mit
- Created: 2019-11-12T15:02:34.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-09T07:39:04.000Z (over 4 years ago)
- Last Synced: 2024-10-23T23:15:47.958Z (2 months ago)
- Topics: 103cuong, code, number-code, numcode, otp-code
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/numcode
- Size: 210 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# numcode
6️⃣7️⃣ Generating codes is easy and simple.
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg)](#contributors)
[![Build Status](https://travis-ci.com/103cuong/numcode.svg?branch=master)](https://travis-ci.com/103cuong/numcode)
![npm](https://img.shields.io/npm/v/numcode.svg)
![david](https://img.shields.io/david/103cuong/numcode.svg)
[![Hits-of-Code](https://hitsofcode.com/github/103cuong/numcode)](https://hitsofcode.com/view/github/103cuong/numcode)
[![GitHub](https://img.shields.io/github/license/103cuong/numcode.svg)](https://github.com/103cuong/numcode/blob/master/LICENSE)## Installation
```sh
yarn add numcode
# or
npm install -s numcode
```## Usage
**For ES6 or ESNext**
```javascript
import { numcode } from 'numcode';
```**For CommonJS**
```javascript
const { numcode } = require('numcode');
``````javascript
console.log(numcode());
``````sh
Output should be '1998'
```## API
### `numcode(length)`
**Returns** `string` unique id with length option (length from 4 to 6).
**Example**
```javascript
numcode(6);
``````sh
Output should be '122856'
```## Contributors
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
## License
MIT © [103cuong](https://github.com/103cuong)