https://github.com/shimohq/fixed-guid
Fixed guid generator based on node.js & redis
https://github.com/shimohq/fixed-guid
Last synced: 6 months ago
JSON representation
Fixed guid generator based on node.js & redis
- Host: GitHub
- URL: https://github.com/shimohq/fixed-guid
- Owner: shimohq
- Created: 2017-11-16T14:22:09.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-16T14:55:37.000Z (almost 8 years ago)
- Last Synced: 2025-02-15T07:47:15.656Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# fixed-guid
# Install
`npm install fixed-guid`
# How to Use
```javascript
const IORedis = require('ioredis')
const FixedGuid = require('fixed-guid')const fixedGuid = new FixedGuid({
redis: new IORedis()
})const main = async () => {
const guid = await FixedGuid.run()
}main().catch(console.log)
```## notes
* `guid` is a uuid, next time you run the script, the guid will be as the same as this one.* If you have multiple processes, the order of the guids will be almost guaranteed.
* if some process will not be run any more, the guid will be deleted after 30min
# LICENSE
MIT