Files
idgenerator/TypeScript
bonn 2308932d25 增加TypeScript版本及其他优化 (#11)
* 基本可运行,待优化

* 增加注释

* 增加注释说明,更容易理解

* 提交package-lock.json文件,保证依赖版本一致
2021-08-31 11:42:13 +08:00
..

❄ idgenerator-TypeScript

介绍

项目更多介绍参照:https://github.com/yitter/idgenerator

代码贡献者zhupengfei 在 bubao 布宝 基础上改版而来感谢bubao 布宝

执行测试代码

ts-node test/test.ts

NODE_ENV=development REDIS_HOST=127.0.0.1 

使用

import { Genid } from '../index'


let gen = new Genid({ WorkerId: 1 })
let id1 = gen.NextId()
console.log(id1, id1.toString().length)