https://github.com/markodenic/uniqid
A super simple unique id based on timestamp.
https://github.com/markodenic/uniqid
Last synced: about 2 months ago
JSON representation
A super simple unique id based on timestamp.
- Host: GitHub
- URL: https://github.com/markodenic/uniqid
- Owner: markodenic
- Created: 2019-05-23T09:30:30.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-29T20:41:56.000Z (over 5 years ago)
- Last Synced: 2025-04-12T10:14:55.600Z (about 2 months ago)
- Language: JavaScript
- Homepage: https://uniqid.netlify.com/
- Size: 3.91 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @mdenic/uniqid
[](https://www.npmjs.com/package/@mdenic/uniqid)
[](https://www.npmjs.com/package/@mdenic/uniqid)



A super simple, lightning fast unique id based on the current timestamp in milliseconds, with optional prefix and suffix.
## Install
```
$ npm install @mdenic/uniqid
```## Usage
```js
var uniqid = require("@mdenic/uniqid");uniqid();
//=> "1558604880081" //stringuniqid('hello-');
//=> "hello-1558604880081" //stringuniqid('', '-world');
//=> "1558604880081-world" //stringuniqid('hello-', '-world');
//=> "hello-1558604880081-world" //string```
### Options
| Name | Type | Default Value |
|--------------------------|---------------------------------------------|---------------|
| prefix | String | '' |
| suffix | String | '' |