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: 11 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 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-09T07:39:04.000Z (over 5 years ago)
- Last Synced: 2025-01-21T21:32:34.293Z (about 1 year 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.
[](#contributors)
[](https://travis-ci.com/103cuong/numcode)


[](https://hitsofcode.com/view/github/103cuong/numcode)
[](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)