{"_id":"snowflake.io","_rev":"27-ea11b08908bda07eda6e460b6c393ab4","name":"snowflake.io","dist-tags":{"latest":"4.1.2"},"versions":{"0.0.0-alpha.1":{"name":"snowflake.io","version":"0.0.0-alpha.1","keywords":["snowflake","snowflake.io","snowflake-id","snowflake id","flake id","flake-id","backend"],"author":{"name":"ztes.com","email":"xy@ztes.com"},"license":"MIT","_id":"snowflake.io@0.0.0-alpha.1","homepage":"https://github.com/ztes/snowflake.io#readme","bugs":{"url":"https://github.com/ztes/snowflake.io/issues"},"blog":"https://ztes.com","dist":{"shasum":"ee3af3886a19b529a0b1889835377182ea1279fa","tarball":"https://registry.npmjs.org/snowflake.io/-/snowflake.io-0.0.0-alpha.1.tgz","fileCount":16,"integrity":"sha512-F/YDMbbi6ScOFjzNPCENyrWNlQIrq0H4PvXfvW3xrX1FCqAJtgazmjILB6gSnMTlO8GrB6lz8jA2CMyHImoYfg==","signatures":[{"sig":"MEQCID1qW6tU+LSPY1bPlrbVz3WUpdt8N+XhpdAr2omhKSOcAiAFWmYxYucNmK/POus2cy+VtsbQi+jY6saJLfYLWNboSw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":43722},"main":"framework/umd/snowflake-id-maker.js","module":"framework/es/snowflake-id-maker.js","gitHead":"8740b22bf19c0043a9de9f43e1dd4cbb32acbafb","scripts":{"dev":"set NODE_ENV=developemnt&& rollup -c rollup.config.js -w","build":"rollup -c rollup.config.js","create":"tsc","publish":"npm publish --access=public","build:pkg":"rollup --config rollup.config.js","eslint:fix":"eslint --fix ./"},"typings":"framework/es/index.d.ts","_npmUser":{"name":"ztes","email":"xy@ztes.com"},"repository":{"url":"git+https://github.com/ztes/snowflake.io.git","type":"git"},"_npmVersion":"10.7.0","description":"Snowflake ID generator generates k ordered and conflict-free snowflake IDs in a distributed environment.","directories":{},"_nodeVersion":"18.19.0","dependencies":{"bigint-conversion":"^2.4.3"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.17.0","rollup":"^2.79.1","core-js":"3","prettier":"^2.8.8","@types/qs":"^6.9.7","typescript":"^4.4.4","@babel/core":"^7.18.6","@types/node":"^18.7.6","@babel/preset-env":"^7.15.8","rollup-plugin-dts":"^4.2.2","@types/flake-idgen":"^0.1.34","@types/webpack-env":"^1.17.0","rollup-plugin-copy":"^3.5.0","@rollup/plugin-json":"^6.0.0","rollup-plugin-babel":"^4.4.0","eslint-define-config":"^1.5.0","rollup-plugin-eslint":"^7.0.0","rollup-plugin-uglify":"^6.0.4","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.0.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-typescript":"^1.0.1","@typescript-eslint/parser":"^5.0.0","rollup-plugin-typescript2":"^0.31.1","rollup-plugin-node-resolve":"^5.2.0","@typescript-eslint/eslint-plugin":"^5.59.2"},"_npmOperationalInternal":{"tmp":"tmp/snowflake.io_0.0.0-alpha.1_1719648745641_0.897233700951876","host":"s3://npm-registry-packages"}},"0.0.0-alpha.2":{"name":"snowflake.io","version":"0.0.0-alpha.2","keywords":["snowflake","snowflake.io","snowflake-id","snowflake id","flake id","flake-id","backend"],"author":{"name":"ztes.com","email":"xy@ztes.com"},"license":"MIT","_id":"snowflake.io@0.0.0-alpha.2","homepage":"https://github.com/ztes/snowflake.io#readme","bugs":{"url":"https://github.com/ztes/snowflake.io/issues"},"blog":"https://ztes.com","dist":{"shasum":"61b2cd9ba1974e13bf112f50996c932c6b6ca158","tarball":"https://registry.npmjs.org/snowflake.io/-/snowflake.io-0.0.0-alpha.2.tgz","fileCount":16,"integrity":"sha512-n6BqMpJmZSy2kXelOyXgRSFtcz1zq9jAnS6EMfeF2adhJ9NX5pWjKDFdmpO5e3P+A/LuoHwKFXyBRdKIxEFrtA==","signatures":[{"sig":"MEUCIQCS1Ck/eVf2I/aH7uTp7krGGhI85MGl4TPjcX51Gy4a7AIgU3YM5Acu7omddtADJCKoUJoZsoQpkQyv0+2+/ul52Gw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":43652},"main":"framework/umd/snowflake-id-maker.js","module":"framework/es/snowflake-id-maker.js","gitHead":"8740b22bf19c0043a9de9f43e1dd4cbb32acbafb","scripts":{"dev":"set NODE_ENV=developemnt&& rollup -c rollup.config.js -w","build":"rollup -c rollup.config.js","create":"tsc","publish":"npm publish --access=public","build:pkg":"rollup --config rollup.config.js","eslint:fix":"eslint --fix ./"},"typings":"framework/es/index.d.ts","_npmUser":{"name":"ztes","email":"xy@ztes.com"},"repository":{"url":"git+https://github.com/ztes/snowflake.io.git","type":"git"},"_npmVersion":"10.7.0","description":"Snowflake.io, generates k-ordered, conflict-free snowflake IDs in a distributed environment.","directories":{},"_nodeVersion":"18.19.0","dependencies":{"bigint-conversion":"^2.4.3"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.17.0","rollup":"^2.79.1","core-js":"3","prettier":"^2.8.8","@types/qs":"^6.9.7","typescript":"^4.4.4","@babel/core":"^7.18.6","@types/node":"^18.7.6","@babel/preset-env":"^7.15.8","rollup-plugin-dts":"^4.2.2","@types/flake-idgen":"^0.1.34","@types/webpack-env":"^1.17.0","rollup-plugin-copy":"^3.5.0","@rollup/plugin-json":"^6.0.0","rollup-plugin-babel":"^4.4.0","eslint-define-config":"^1.5.0","rollup-plugin-eslint":"^7.0.0","rollup-plugin-uglify":"^6.0.4","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.0.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-typescript":"^1.0.1","@typescript-eslint/parser":"^5.0.0","rollup-plugin-typescript2":"^0.31.1","rollup-plugin-node-resolve":"^5.2.0","@typescript-eslint/eslint-plugin":"^5.59.2"},"_npmOperationalInternal":{"tmp":"tmp/snowflake.io_0.0.0-alpha.2_1719649100158_0.17644656140587767","host":"s3://npm-registry-packages"}},"0.0.0-alpha.3":{"name":"snowflake.io","version":"0.0.0-alpha.3","keywords":["snowflake","snowflake.io","snowflake-id","flake-id","雪花算法","雪花id","backend"],"author":{"name":"ztes.com","email":"xy@ztes.com"},"license":"MIT","_id":"snowflake.io@0.0.0-alpha.3","homepage":"https://github.com/ztes/snowflake.io#readme","bugs":{"url":"https://github.com/ztes/snowflake.io/issues"},"blog":"https://ztes.com","dist":{"shasum":"cfc63451c9393bd4cac74afb5e0eb9384d3b2c4a","tarball":"https://registry.npmjs.org/snowflake.io/-/snowflake.io-0.0.0-alpha.3.tgz","fileCount":16,"integrity":"sha512-4Nt2WQVIuIbm0HBHkZGlDmtsnn1RH/wV0alg/oJtOKyLXrynyj/WS2nnREfTjMrZy4jI3mWpm2tCK0qxXFGqgA==","signatures":[{"sig":"MEUCIQCciF4oFtWNS9apHfMUwkRbZ/b40U0+nBAj3xIYbjpk3AIgeM05htNRTnKNq98No7LmWPIlLie425nKdLKd4LSNONI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":43652},"main":"framework/umd/snowflake-id-maker.js","module":"framework/es/snowflake-id-maker.js","gitHead":"8740b22bf19c0043a9de9f43e1dd4cbb32acbafb","scripts":{"dev":"set NODE_ENV=developemnt&& rollup -c rollup.config.js -w","build":"rollup -c rollup.config.js","create":"tsc","publish":"npm publish --access=public","build:pkg":"rollup --config rollup.config.js","eslint:fix":"eslint --fix ./"},"typings":"framework/es/index.d.ts","_npmUser":{"name":"ztes","email":"xy@ztes.com"},"repository":{"url":"git+https://github.com/ztes/snowflake.io.git","type":"git"},"_npmVersion":"10.7.0","description":"Snowflake.io, generates k-ordered, conflict-free snowflake IDs in a distributed environment.","directories":{},"_nodeVersion":"18.19.0","dependencies":{"bigint-conversion":"^2.4.3"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.17.0","rollup":"^2.79.1","core-js":"3","prettier":"^2.8.8","@types/qs":"^6.9.7","typescript":"^4.4.4","@babel/core":"^7.18.6","@types/node":"^18.7.6","@babel/preset-env":"^7.15.8","rollup-plugin-dts":"^4.2.2","@types/flake-idgen":"^0.1.34","@types/webpack-env":"^1.17.0","rollup-plugin-copy":"^3.5.0","@rollup/plugin-json":"^6.0.0","rollup-plugin-babel":"^4.4.0","eslint-define-config":"^1.5.0","rollup-plugin-eslint":"^7.0.0","rollup-plugin-uglify":"^6.0.4","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.0.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-typescript":"^1.0.1","@typescript-eslint/parser":"^5.0.0","rollup-plugin-typescript2":"^0.31.1","rollup-plugin-node-resolve":"^5.2.0","@typescript-eslint/eslint-plugin":"^5.59.2"},"_npmOperationalInternal":{"tmp":"tmp/snowflake.io_0.0.0-alpha.3_1719650026978_0.7368606348648974","host":"s3://npm-registry-packages"}},"0.0.0-alpha.4":{"name":"snowflake.io","version":"0.0.0-alpha.4","keywords":["snowflake","snowflake.io","snowflake-id","snowflake id","flake-id","雪花算法","雪花id","backend"],"author":{"name":"ztes.com","email":"xy@ztes.com"},"license":"MIT","_id":"snowflake.io@0.0.0-alpha.4","maintainers":[{"name":"ztes","email":"xy@ztes.com"}],"homepage":"https://github.com/ztes/snowflake.io#readme","bugs":{"url":"https://github.com/ztes/snowflake.io/issues"},"blog":"https://ztes.com","dist":{"shasum":"c69ce741a39d107184ec591f9ec585f6190040e3","tarball":"https://registry.npmjs.org/snowflake.io/-/snowflake.io-0.0.0-alpha.4.tgz","fileCount":16,"integrity":"sha512-b86iEKNt1zX4YZGdDNSfAZN48FW/e82ZBIwE96kKL27V0juDI/7osaOBjU2VdjaLdVjeBInZumh5RQuuCzvnWQ==","signatures":[{"sig":"MEUCIQDrguz9JFJtJBbCtokoTK8VydbRPEMBVCJ/stlC1YfxiwIgBkfT0MSHq/I6hwPJK+xcI+TZwfp6cWo36ME2h27cz3M=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":36495},"main":"./framework/umd/snowflake.io.js","type":"module","types":"./framework/es/index.d.ts","module":"./framework/es/snowflake.io.js","exports":{".":{"types":"./framework/es/index.d.ts","import":"./framework/es/snowflake.io.js","require":"./framework/umd/snowflake.io.js"}},"gitHead":"32156d4ebad6f5857d5a025f857883e8f0056ffd","scripts":{"dev":"set NODE_ENV=developemnt&& rollup -c rollup.config.js -w","build":"rollup -c rollup.config.js","create":"tsc","publish":"npm publish --access=public","build:pkg":"rm -rf framework && rollup --config rollup.config.js","eslint:fix":"eslint --fix ./"},"_npmUser":{"name":"ztes","email":"xy@ztes.com"},"repository":{"url":"git+https://github.com/ztes/snowflake.io.git","type":"git"},"_npmVersion":"10.7.0","description":"Snowflake.io, generates k-ordered, conflict-free snowflake IDs in a distributed environment.","directories":{},"_nodeVersion":"18.20.4","dependencies":{"bigint-conversion":"^2.4.3"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.17.0","rollup":"^2.79.1","core-js":"3","prettier":"^2.8.8","@types/qs":"^6.9.7","typescript":"^4.4.4","@babel/core":"^7.18.6","@types/node":"^18.7.6","@babel/preset-env":"^7.15.8","rollup-plugin-dts":"^4.2.2","@types/webpack-env":"^1.17.0","rollup-plugin-copy":"^3.5.0","@rollup/plugin-json":"^6.0.0","@rollup/plugin-babel":"^6.0.4","eslint-define-config":"^1.5.0","rollup-plugin-eslint":"^7.0.0","rollup-plugin-terser":"^7.0.2","rollup-plugin-uglify":"^6.0.4","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.0.0","rollup-plugin-commonjs":"^10.1.0","@rollup/plugin-commonjs":"^28.0.3","rollup-plugin-typescript":"^1.0.1","@typescript-eslint/parser":"^5.0.0","rollup-plugin-typescript2":"^0.31.1","rollup-plugin-node-resolve":"^5.2.0","@rollup/plugin-node-resolve":"^16.0.1","@typescript-eslint/eslint-plugin":"^5.59.2"},"_npmOperationalInternal":{"tmp":"tmp/snowflake.io_0.0.0-alpha.4_1746685102254_0.46806141351642716","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-alpha.5":{"name":"snowflake.io","version":"0.0.0-alpha.5","keywords":["snowflake","snowflake.io","snowflake-id","snowflake id","flake-id","雪花算法","雪花id","backend"],"author":{"name":"ztes.com","email":"xy@ztes.com"},"license":"MIT","_id":"snowflake.io@0.0.0-alpha.5","maintainers":[{"name":"ztes","email":"xy@ztes.com"}],"homepage":"https://github.com/ztes/snowflake.io#readme","bugs":{"url":"https://github.com/ztes/snowflake.io/issues"},"blog":"https://ztes.com","dist":{"shasum":"bc6749624d59fa3c830f57c26ce00e95ecdb1682","tarball":"https://registry.npmjs.org/snowflake.io/-/snowflake.io-0.0.0-alpha.5.tgz","fileCount":16,"integrity":"sha512-TQBCs3Yn/o4mEhGcdo7uRbjLaZfFWC4mt0bZzfrZdoij8zQWyYTqRuYb1OJ+EQqQPKvKh8WgsoQfDmOp2R4Fnw==","signatures":[{"sig":"MEUCIGPwDIWdE40VMH0EQn9wyK4sgUJD35B2MxTrm0CpG6e5AiEA24YYromdQNoAz59vssR0dI/JJXL/v0KFIqdJrd04JBc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35756},"main":"./framework/umd/snowflake.io.js","type":"module","types":"./framework/es/index.d.ts","module":"./framework/es/snowflake.io.js","exports":{".":{"import":"./framework/es/snowflake.io.js","require":"./framework/cjs/snowflake.io.js"}},"gitHead":"32156d4ebad6f5857d5a025f857883e8f0056ffd","scripts":{"dev":"set NODE_ENV=developemnt&& rollup -c rollup.config.js -w","build":"rollup -c rollup.config.js","create":"tsc","publish":"npm publish --access=public","build:pkg":"rm -rf framework && rollup --config rollup.config.js","eslint:fix":"eslint --fix ./"},"_npmUser":{"name":"ztes","email":"xy@ztes.com"},"repository":{"url":"git+https://github.com/ztes/snowflake.io.git","type":"git"},"_npmVersion":"10.7.0","description":"Snowflake.io, generates k-ordered, conflict-free snowflake IDs in a distributed environment.","directories":{},"_nodeVersion":"18.20.4","dependencies":{"bigint-conversion":"^2.4.3"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.17.0","rollup":"^2.79.1","core-js":"3","prettier":"^2.8.8","@types/qs":"^6.9.7","typescript":"^4.4.4","@babel/core":"^7.18.6","@types/node":"^18.7.6","@babel/preset-env":"^7.15.8","rollup-plugin-dts":"^4.2.2","@types/webpack-env":"^1.17.0","rollup-plugin-copy":"^3.5.0","@rollup/plugin-json":"^6.0.0","@rollup/plugin-babel":"^6.0.4","eslint-define-config":"^1.5.0","rollup-plugin-eslint":"^7.0.0","rollup-plugin-terser":"^7.0.2","rollup-plugin-uglify":"^6.0.4","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.0.0","rollup-plugin-commonjs":"^10.1.0","@rollup/plugin-commonjs":"^28.0.3","rollup-plugin-typescript":"^1.0.1","@typescript-eslint/parser":"^5.0.0","rollup-plugin-typescript2":"^0.31.1","rollup-plugin-node-resolve":"^5.2.0","@rollup/plugin-node-resolve":"^16.0.1","@typescript-eslint/eslint-plugin":"^5.59.2"},"_npmOperationalInternal":{"tmp":"tmp/snowflake.io_0.0.0-alpha.5_1746686076791_0.5574602697598652","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-alpha.6":{"name":"snowflake.io","version":"0.0.0-alpha.6","keywords":["snowflake","snowflake.io","snowflake-id","snowflake id","flake-id","雪花算法","雪花id","backend"],"author":{"name":"ztes.com","email":"xy@ztes.com"},"license":"MIT","_id":"snowflake.io@0.0.0-alpha.6","maintainers":[{"name":"ztes","email":"xy@ztes.com"}],"homepage":"https://github.com/ztes/snowflake.io#readme","bugs":{"url":"https://github.com/ztes/snowflake.io/issues"},"blog":"https://ztes.com","dist":{"shasum":"ab3170309922b9b3b4bfdc2408f3f1c6d1cba56f","tarball":"https://registry.npmjs.org/snowflake.io/-/snowflake.io-0.0.0-alpha.6.tgz","fileCount":8,"integrity":"sha512-dqB6a97WnJgnqnHjaux4UYlTw7IfhvMhTHPi8tL/AXwCMXnOMZxTtCxEr3dJujWA74Wbz+eaEvgjpXDD61x4Ng==","signatures":[{"sig":"MEYCIQDqmCW2IUOQJ1hBNO7BuLPivr4VwVUqtOZFYJ+rdWICLwIhAI5sPSmrBGNiQTBXjx4YfbLllvt1f7JNOSgPAGktCbo9","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31271},"main":"./framework/cjs/snowflake.io.cjs","type":"module","types":"./framework/es/index.d.ts","module":"./framework/es/snowflake.io.js","exports":{".":{"import":"./framework/es/snowflake.io.js","require":"./framework/cjs/snowflake.io.cjs"}},"gitHead":"32156d4ebad6f5857d5a025f857883e8f0056ffd","scripts":{"dev":"set NODE_ENV=developemnt&& rollup -c rollup.config.js -w","build":"rollup -c rollup.config.js","create":"tsc","publish":"npm publish --access=public","build:pkg":"rm -rf framework && rollup --config rollup.config.js","eslint:fix":"eslint --fix ./"},"_npmUser":{"name":"ztes","email":"xy@ztes.com"},"repository":{"url":"git+https://github.com/ztes/snowflake.io.git","type":"git"},"_npmVersion":"10.7.0","description":"Snowflake.io, generates k-ordered, conflict-free snowflake IDs in a distributed environment.","directories":{},"_nodeVersion":"18.20.4","dependencies":{"bigint-conversion":"^2.4.3"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.17.0","rollup":"^2.79.1","core-js":"3","prettier":"^2.8.8","@types/qs":"^6.9.7","typescript":"^4.4.4","@babel/core":"^7.18.6","@types/node":"^18.7.6","@babel/preset-env":"^7.15.8","rollup-plugin-dts":"^4.2.2","@types/webpack-env":"^1.17.0","rollup-plugin-copy":"^3.5.0","@rollup/plugin-json":"^6.0.0","@rollup/plugin-babel":"^6.0.4","eslint-define-config":"^1.5.0","rollup-plugin-eslint":"^7.0.0","rollup-plugin-terser":"^7.0.2","rollup-plugin-uglify":"^6.0.4","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.0.0","rollup-plugin-commonjs":"^10.1.0","@rollup/plugin-commonjs":"^28.0.3","rollup-plugin-typescript":"^1.0.1","@typescript-eslint/parser":"^5.0.0","rollup-plugin-typescript2":"^0.31.1","rollup-plugin-node-resolve":"^5.2.0","@rollup/plugin-node-resolve":"^16.0.1","@typescript-eslint/eslint-plugin":"^5.59.2"},"_npmOperationalInternal":{"tmp":"tmp/snowflake.io_0.0.0-alpha.6_1746686726250_0.09726891514532121","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-alpha.7":{"name":"snowflake.io","version":"0.0.0-alpha.7","keywords":["snowflake","snowflake.io","snowflake-id","snowflake id","flake-id","雪花算法","雪花id","backend"],"author":{"name":"ztes.com","email":"xy@ztes.com"},"license":"MIT","_id":"snowflake.io@0.0.0-alpha.7","maintainers":[{"name":"ztes","email":"xy@ztes.com"}],"homepage":"https://github.com/ztes/snowflake.io#readme","bugs":{"url":"https://github.com/ztes/snowflake.io/issues"},"blog":"https://ztes.com","dist":{"shasum":"02fcc61d2e2d53e42f39a34f10be000c3a61b4f4","tarball":"https://registry.npmjs.org/snowflake.io/-/snowflake.io-0.0.0-alpha.7.tgz","fileCount":8,"integrity":"sha512-MwjefAOJrg8KAl7PVyU4ZDQCb1PArC640Tv5A0FzTRGCSP6chb0oSWT1Q5UdzSQEA7VOmtO7hcc9lQCc6Y9YOQ==","signatures":[{"sig":"MEQCIF91D3QqQZNePOU9yNucHjYN8/zLt0Y047qQ/nMaASTVAiBSIJIPqQ+ULO3RgPhpxD9YrSJMb+Ladk6O1I4tkdmmRQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27757},"main":"./framework/cjs/snowflake.io.cjs","type":"module","types":"./framework/es/index.d.ts","module":"./framework/es/snowflake.io.js","exports":{".":{"import":"./framework/es/snowflake.io.js","require":"./framework/cjs/snowflake.io.cjs"}},"gitHead":"32156d4ebad6f5857d5a025f857883e8f0056ffd","scripts":{"dev":"set NODE_ENV=developemnt&& rollup -c rollup.config.js -w","build":"rollup -c rollup.config.js","create":"tsc","publish":"npm publish --access=public","build:pkg":"rm -rf framework && rollup --config rollup.config.js","eslint:fix":"eslint --fix ./"},"_npmUser":{"name":"ztes","email":"xy@ztes.com"},"repository":{"url":"git+https://github.com/ztes/snowflake.io.git","type":"git"},"_npmVersion":"10.7.0","description":"Snowflake.io, generates k-ordered, conflict-free snowflake IDs in a distributed environment.","directories":{},"_nodeVersion":"18.20.4","dependencies":{"bigint-conversion":"^2.4.3"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.17.0","rollup":"^2.79.1","core-js":"3","prettier":"^2.8.8","@types/qs":"^6.9.7","typescript":"^4.4.4","@babel/core":"^7.18.6","@types/node":"^18.7.6","@babel/preset-env":"^7.15.8","rollup-plugin-dts":"^4.2.2","@types/webpack-env":"^1.17.0","rollup-plugin-copy":"^3.5.0","@rollup/plugin-json":"^6.0.0","@rollup/plugin-babel":"^6.0.4","eslint-define-config":"^1.5.0","rollup-plugin-eslint":"^7.0.0","rollup-plugin-terser":"^7.0.2","rollup-plugin-uglify":"^6.0.4","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.0.0","rollup-plugin-commonjs":"^10.1.0","@rollup/plugin-commonjs":"^28.0.3","rollup-plugin-typescript":"^1.0.1","@typescript-eslint/parser":"^5.0.0","rollup-plugin-typescript2":"^0.31.1","rollup-plugin-node-resolve":"^5.2.0","@rollup/plugin-node-resolve":"^16.0.1","@typescript-eslint/eslint-plugin":"^5.59.2"},"_npmOperationalInternal":{"tmp":"tmp/snowflake.io_0.0.0-alpha.7_1746689069018_0.9811686496312468","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-alpha.8":{"name":"snowflake.io","version":"0.0.0-alpha.8","keywords":["snowflake","snowflake.io","snowflake-id","snowflake id","flake-id","雪花算法","雪花id","backend"],"author":{"name":"ztes.com","email":"xy@ztes.com"},"license":"MIT","_id":"snowflake.io@0.0.0-alpha.8","maintainers":[{"name":"ztes","email":"xy@ztes.com"}],"homepage":"https://github.com/ztes/snowflake.io#readme","bugs":{"url":"https://github.com/ztes/snowflake.io/issues"},"blog":"https://ztes.com","dist":{"shasum":"01e3643088d2fc517a32cd8a5be328957c4df937","tarball":"https://registry.npmjs.org/snowflake.io/-/snowflake.io-0.0.0-alpha.8.tgz","fileCount":8,"integrity":"sha512-iSk/TzTnEssUscTKNPJ4v9xt95n2hc5muUESi9oILZxADwehFW/NoXs2nMi9uCCpqvP9fQqBmRgaE0dgT+DyfA==","signatures":[{"sig":"MEUCIQDWzw2YXruo0n24dK0KUWbra0AU8uXoRT3Q3lxov8NGdQIgMOIQutGn1lOT67/TkAOdvZt6QZ4VsB3FwMeVPgySinI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28844},"main":"./framework/cjs/snowflake.io.cjs","type":"module","types":"./framework/es/index.d.ts","module":"./framework/es/snowflake.io.js","exports":{".":{"import":"./framework/es/snowflake.io.js","require":"./framework/cjs/snowflake.io.cjs"}},"gitHead":"32156d4ebad6f5857d5a025f857883e8f0056ffd","scripts":{"dev":"set NODE_ENV=developemnt&& rollup -c rollup.config.js -w","build":"rollup -c rollup.config.js","create":"tsc","publish":"npm publish --access=public","build:pkg":"rm -rf framework && rollup --config rollup.config.js","eslint:fix":"eslint --fix ./"},"_npmUser":{"name":"ztes","email":"xy@ztes.com"},"repository":{"url":"git+https://github.com/ztes/snowflake.io.git","type":"git"},"_npmVersion":"10.7.0","description":"Snowflake.io, generates k-ordered, conflict-free snowflake IDs in a distributed environment.","directories":{},"_nodeVersion":"18.20.4","dependencies":{"bigint-conversion":"^2.4.3"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.17.0","rollup":"^2.79.1","core-js":"3","prettier":"^2.8.8","@types/qs":"^6.9.7","typescript":"^4.4.4","@babel/core":"^7.18.6","@types/node":"^18.7.6","@babel/preset-env":"^7.15.8","rollup-plugin-dts":"^4.2.2","@types/webpack-env":"^1.17.0","rollup-plugin-copy":"^3.5.0","@rollup/plugin-json":"^6.0.0","@rollup/plugin-babel":"^6.0.4","eslint-define-config":"^1.5.0","rollup-plugin-eslint":"^7.0.0","rollup-plugin-terser":"^7.0.2","rollup-plugin-uglify":"^6.0.4","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.0.0","rollup-plugin-commonjs":"^10.1.0","@rollup/plugin-commonjs":"^28.0.3","rollup-plugin-typescript":"^1.0.1","@typescript-eslint/parser":"^5.0.0","rollup-plugin-typescript2":"^0.31.1","rollup-plugin-node-resolve":"^5.2.0","@rollup/plugin-node-resolve":"^16.0.1","@typescript-eslint/eslint-plugin":"^5.59.2"},"_npmOperationalInternal":{"tmp":"tmp/snowflake.io_0.0.0-alpha.8_1746689870499_0.3323184912070385","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"snowflake.io","version":"1.0.0","keywords":["snowflake","snowflake.io","snowflake-id","snowflake id","flake-id","雪花算法","雪花id","backend"],"author":{"name":"ztes.com","email":"xy@ztes.com"},"license":"MIT","_id":"snowflake.io@1.0.0","maintainers":[{"name":"ztes","email":"xy@ztes.com"}],"homepage":"https://github.com/ztes/snowflake.io#readme","bugs":{"url":"https://github.com/ztes/snowflake.io/issues"},"blog":"https://ztes.com","dist":{"shasum":"ff772f3453172cd17b0c1e5a9c3cff6f9673eb0b","tarball":"https://registry.npmjs.org/snowflake.io/-/snowflake.io-1.0.0.tgz","fileCount":8,"integrity":"sha512-tmzYmVUtB9PZ9TUkcm/x6PEXTgMyhkF1jPp44Ixme7XXwB/a6wkdId7TzYKPVxKgOTXW3V1vjzBvpxlcHxiIUg==","signatures":[{"sig":"MEUCIQDCGpjJq/85/Da7cuN5eaLDo3N1BRgQtteW+tVgoxcT7AIgL0nGwBICfAnM5RpbVmeDBSbZDRUNAZgHD4fRjETKhw8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28848},"main":"./framework/cjs/snowflake.io.cjs","type":"module","types":"./framework/es/index.d.ts","module":"./framework/es/snowflake.io.js","exports":{".":{"import":"./framework/es/snowflake.io.js","require":"./framework/cjs/snowflake.io.cjs"}},"gitHead":"876c9a1d4ec69a7020a7079fef25833257dd3364","scripts":{"dev":"set NODE_ENV=developemnt&& rollup -c rollup.config.js -w","build":"rollup -c rollup.config.js","create":"tsc","publish":"npm publish --access=public","build:pkg":"rm -rf framework && rollup --config rollup.config.js","eslint:fix":"eslint --fix ./"},"_npmUser":{"name":"ztes","email":"xy@ztes.com"},"repository":{"url":"git+https://github.com/ztes/snowflake.io.git","type":"git"},"_npmVersion":"10.7.0","description":"Snowflake.io, generates k-ordered, conflict-free snowflake IDs in a distributed environment.","directories":{},"_nodeVersion":"18.20.4","dependencies":{"bigint-conversion":"^2.4.3"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.17.0","rollup":"^2.79.1","core-js":"3","prettier":"^2.8.8","@types/qs":"^6.9.7","typescript":"^4.4.4","@babel/core":"^7.18.6","@types/node":"^18.7.6","@babel/preset-env":"^7.15.8","rollup-plugin-dts":"^4.2.2","@types/webpack-env":"^1.17.0","rollup-plugin-copy":"^3.5.0","@rollup/plugin-json":"^6.0.0","@rollup/plugin-babel":"^6.0.4","eslint-define-config":"^1.5.0","rollup-plugin-eslint":"^7.0.0","rollup-plugin-terser":"^7.0.2","rollup-plugin-uglify":"^6.0.4","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.0.0","rollup-plugin-commonjs":"^10.1.0","@rollup/plugin-commonjs":"^28.0.3","rollup-plugin-typescript":"^1.0.1","@typescript-eslint/parser":"^5.0.0","rollup-plugin-typescript2":"^0.31.1","rollup-plugin-node-resolve":"^5.2.0","@rollup/plugin-node-resolve":"^16.0.1","@typescript-eslint/eslint-plugin":"^5.59.2"},"_npmOperationalInternal":{"tmp":"tmp/snowflake.io_1.0.0_1746690199077_0.5735800399259416","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"snowflake.io","version":"2.0.1","keywords":["snowflake","snowflake.io","snowflake-id","snowflake id","flake-id","unique-id","distributed","distributed-systems","id-generator","unique-id-generator","distributed-id","twitter-snowflake","bigint","typescript","esm","commonjs","cjs","nodejs","browser","microservices","k-ordered","clock-drift","clock-skew","high-performance","scalable","uuid-alternative","雪花算法","雪花id","分布式id","唯一id","分布式系统","id生成器","后端","backend"],"author":{"name":"ztes.com","email":"xy@ztes.com"},"license":"MIT","_id":"snowflake.io@2.0.1","maintainers":[{"name":"ztes","email":"xy@ztes.com"}],"homepage":"https://github.com/ztes/snowflake.io#readme","bugs":{"url":"https://github.com/ztes/snowflake.io/issues"},"blog":"https://ztes.com","dist":{"shasum":"4eb1321a99a4cc9c63e21a2b5467dbac4d0fc042","tarball":"https://registry.npmjs.org/snowflake.io/-/snowflake.io-2.0.1.tgz","fileCount":17,"integrity":"sha512-0PLP14SBVRKd5tUNoaFEmEGoxTyZCUfsqY4yEIFD4Wf1wvW0msMqssUC6O+wBRKfUKpmxftX0Q1m/hemOFVyuA==","signatures":[{"sig":"MEYCIQC429CcFJe1ljgPBHOUhIXHDLSLaLxkEzDPGMFs4hcmvgIhAOFOf2nvzvZEqqR9gNHN2CIM3jhWYuQrJ0wSa2unUW0Y","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":59313},"main":"./lib/index.js","type":"module","types":"./lib/index.d.ts","module":"./lib/index.js","engines":{"node":">=14.0.0"},"exports":{".":{"types":"./lib/index.d.ts","import":"./lib/index.js","require":"./lib/index.js"},"./package.json":"./package.json"},"gitHead":"1b665abe4ff7a8409dd390bda037a9c6b3024f05","scripts":{"dev":"set NODE_ENV=development && tsc --watch","test":"node lib/test.js","build":"tsc","create":"tsc","publish":"npm publish --access=public","build:pkg":"rm -rf lib && tsc","eslint:fix":"eslint --fix ./","test:example":"node src/distributed-example.mjs"},"_npmUser":{"name":"ztes","email":"xy@ztes.com"},"repository":{"url":"git+https://github.com/ztes/snowflake.io.git","type":"git"},"_npmVersion":"10.9.3","description":"High-performance distributed unique ID generator based on Twitter's Snowflake algorithm. Supports ESM and CommonJS with BigInt for precision.","directories":{},"_nodeVersion":"22.19.0","dependencies":{"bigint-conversion":"^2.4.3"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.17.0","rollup":"^2.79.1","core-js":"3","prettier":"^2.8.8","@types/qs":"^6.9.7","typescript":"^4.4.4","@babel/core":"^7.18.6","@types/node":"^18.7.6","@babel/preset-env":"^7.15.8","rollup-plugin-dts":"^4.2.2","@types/webpack-env":"^1.17.0","rollup-plugin-copy":"^3.5.0","@rollup/plugin-json":"^6.0.0","@rollup/plugin-babel":"^6.0.4","eslint-define-config":"^1.5.0","rollup-plugin-eslint":"^7.0.0","rollup-plugin-terser":"^7.0.2","rollup-plugin-uglify":"^6.0.4","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.0.0","rollup-plugin-commonjs":"^10.1.0","@rollup/plugin-commonjs":"^28.0.3","rollup-plugin-typescript":"^1.0.1","@typescript-eslint/parser":"^5.0.0","rollup-plugin-typescript2":"^0.31.1","rollup-plugin-node-resolve":"^5.2.0","@rollup/plugin-node-resolve":"^16.0.1","@typescript-eslint/eslint-plugin":"^5.59.2"},"_npmOperationalInternal":{"tmp":"tmp/snowflake.io_2.0.1_1763022511795_0.5055981818185724","host":"s3://npm-registry-packages-npm-production"}},"2.0.2":{"name":"snowflake.io","version":"2.0.2","keywords":["snowflake","snowflake.io","snowflake-id","snowflake id","flake-id","unique-id","distributed","distributed-systems","id-generator","unique-id-generator","distributed-id","twitter-snowflake","bigint","typescript","esm","commonjs","cjs","nodejs","browser","microservices","k-ordered","clock-drift","clock-skew","high-performance","scalable","uuid-alternative","雪花算法","雪花id","分布式id","唯一id","分布式系统","id生成器","后端","backend"],"author":{"name":"ztes.com","email":"xy@ztes.com"},"license":"MIT","_id":"snowflake.io@2.0.2","maintainers":[{"name":"ztes","email":"xy@ztes.com"}],"homepage":"https://github.com/ztes/snowflake.io#readme","bugs":{"url":"https://github.com/ztes/snowflake.io/issues"},"blog":"https://ztes.com","dist":{"shasum":"d50bbcda2213ec17772a114636b3553e22e913a1","tarball":"https://registry.npmjs.org/snowflake.io/-/snowflake.io-2.0.2.tgz","fileCount":17,"integrity":"sha512-YFxa/FAkSEUWUIxh8yOFLWtwgIUCPBpzvmSlearIxQNaLKuI7xIJP0wSQLBKIEbOipn/PxU15P5xmTrz0eXvxA==","signatures":[{"sig":"MEYCIQCQ3InFjm8j04EwdhgJxWUTwYpRoLamRZ6e3bTQM8M1NAIhALoPCy0qu+KBIbxjViOotFWAhMCTGB/TSdPP+MAYkSoX","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":57176},"main":"./lib/index.js","type":"module","types":"./lib/index.d.ts","module":"./lib/index.js","engines":{"node":">=14.0.0"},"exports":{".":{"types":"./lib/index.d.ts","import":"./lib/index.js","require":"./lib/index.js"},"./package.json":"./package.json"},"gitHead":"1b665abe4ff7a8409dd390bda037a9c6b3024f05","scripts":{"dev":"set NODE_ENV=development && tsc --watch","test":"node lib/test.js","build":"tsc","create":"tsc","publish":"npm publish --access=public","build:pkg":"rm -rf lib && tsc","eslint:fix":"eslint --fix ./","test:example":"node src/distributed-example.mjs"},"_npmUser":{"name":"ztes","email":"xy@ztes.com"},"repository":{"url":"git+https://github.com/ztes/snowflake.io.git","type":"git"},"_npmVersion":"10.9.3","description":"High-performance distributed unique ID generator based on Twitter's Snowflake algorithm. Supports ESM and CommonJS with BigInt for precision.","directories":{},"_nodeVersion":"22.19.0","dependencies":{"bigint-conversion":"^2.4.3"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.17.0","rollup":"^2.79.1","core-js":"3","prettier":"^2.8.8","@types/qs":"^6.9.7","typescript":"^4.4.4","@babel/core":"^7.18.6","@types/node":"^18.7.6","@babel/preset-env":"^7.15.8","rollup-plugin-dts":"^4.2.2","@types/webpack-env":"^1.17.0","rollup-plugin-copy":"^3.5.0","@rollup/plugin-json":"^6.0.0","@rollup/plugin-babel":"^6.0.4","eslint-define-config":"^1.5.0","rollup-plugin-eslint":"^7.0.0","rollup-plugin-terser":"^7.0.2","rollup-plugin-uglify":"^6.0.4","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.0.0","rollup-plugin-commonjs":"^10.1.0","@rollup/plugin-commonjs":"^28.0.3","rollup-plugin-typescript":"^1.0.1","@typescript-eslint/parser":"^5.0.0","rollup-plugin-typescript2":"^0.31.1","rollup-plugin-node-resolve":"^5.2.0","@rollup/plugin-node-resolve":"^16.0.1","@typescript-eslint/eslint-plugin":"^5.59.2"},"_npmOperationalInternal":{"tmp":"tmp/snowflake.io_2.0.2_1763023986733_0.10155021653558549","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"snowflake.io","version":"2.1.0","keywords":["snowflake","snowflake.io","snowflake-id","snowflake id","flake-id","unique-id","distributed","distributed-systems","id-generator","unique-id-generator","distributed-id","twitter-snowflake","bigint","typescript","esm","commonjs","cjs","nodejs","browser","microservices","k-ordered","clock-drift","clock-skew","high-performance","scalable","uuid-alternative","雪花算法","雪花id","分布式id","唯一id","分布式系统","id生成器","后端","backend"],"author":{"name":"ztes.com","email":"xy@ztes.com"},"license":"MIT","_id":"snowflake.io@2.1.0","maintainers":[{"name":"ztes","email":"xy@ztes.com"}],"homepage":"https://github.com/ztes/snowflake.io#readme","bugs":{"url":"https://github.com/ztes/snowflake.io/issues"},"blog":"https://ztes.com","dist":{"shasum":"80dd9a4731085d7bf277e90682eeaa55e0bbe584","tarball":"https://registry.npmjs.org/snowflake.io/-/snowflake.io-2.1.0.tgz","fileCount":17,"integrity":"sha512-i17x5aNWxmtuf76GwiNb8MfQaIqQ+Towh+cxZ02tV2JMXSOmzKMXyyB+SJGaLIN9EJM/YQkLkGhXw6VBiWaG5Q==","signatures":[{"sig":"MEUCIQDOsKgHat8um4eVkcTrRPGnz7WCvsgzbxDY9Rt7U8F2WwIgNjrBigH7/sKBwT9mao3v1CjY1+nygj0wNDl6qbMkHlQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":57176},"main":"./lib/index.js","type":"module","types":"./lib/index.d.ts","module":"./lib/index.js","engines":{"node":">=14.0.0"},"exports":{".":{"types":"./lib/index.d.ts","import":"./lib/index.js","require":"./lib/index.js"},"./package.json":"./package.json"},"gitHead":"eb6063156e819ad6991805ec7efc04b4e9d5b702","scripts":{"dev":"set NODE_ENV=development && tsc --watch","test":"node lib/test.js","build":"tsc","create":"tsc","publish":"npm publish --access=public","build:pkg":"rm -rf lib && tsc","eslint:fix":"eslint --fix ./","test:example":"node src/distributed-example.mjs"},"_npmUser":{"name":"ztes","email":"xy@ztes.com"},"repository":{"url":"git+https://github.com/ztes/snowflake.io.git","type":"git"},"_npmVersion":"10.9.3","description":"High-performance distributed unique ID generator based on Twitter's Snowflake algorithm. Supports ESM and CommonJS with BigInt for precision.","directories":{},"_nodeVersion":"22.19.0","dependencies":{"bigint-conversion":"^2.4.3"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.17.0","rollup":"^2.79.1","core-js":"3","prettier":"^2.8.8","@types/qs":"^6.9.7","typescript":"^4.4.4","@babel/core":"^7.18.6","@types/node":"^18.7.6","@babel/preset-env":"^7.15.8","rollup-plugin-dts":"^4.2.2","@types/webpack-env":"^1.17.0","rollup-plugin-copy":"^3.5.0","@rollup/plugin-json":"^6.0.0","@rollup/plugin-babel":"^6.0.4","eslint-define-config":"^1.5.0","rollup-plugin-eslint":"^7.0.0","rollup-plugin-terser":"^7.0.2","rollup-plugin-uglify":"^6.0.4","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.0.0","rollup-plugin-commonjs":"^10.1.0","@rollup/plugin-commonjs":"^28.0.3","rollup-plugin-typescript":"^1.0.1","@typescript-eslint/parser":"^5.0.0","rollup-plugin-typescript2":"^0.31.1","rollup-plugin-node-resolve":"^5.2.0","@rollup/plugin-node-resolve":"^16.0.1","@typescript-eslint/eslint-plugin":"^5.59.2"},"_npmOperationalInternal":{"tmp":"tmp/snowflake.io_2.1.0_1763026205009_0.3732140862224387","host":"s3://npm-registry-packages-npm-production"}},"2.1.2":{"name":"snowflake.io","version":"2.1.2","keywords":["snowflake","snowflake.io","snowflake-id","snowflake id","flake-id","unique-id","distributed","distributed-systems","id-generator","unique-id-generator","distributed-id","twitter-snowflake","bigint","typescript","esm","commonjs","cjs","nodejs","browser","microservices","k-ordered","clock-drift","clock-skew","high-performance","scalable","uuid-alternative","雪花算法","雪花id","分布式id","唯一id","分布式系统","id生成器","后端","backend"],"author":{"name":"ztes.com","email":"xy@ztes.com"},"license":"MIT","_id":"snowflake.io@2.1.2","maintainers":[{"name":"ztes","email":"xy@ztes.com"}],"homepage":"https://github.com/ztes/snowflake.io#readme","bugs":{"url":"https://github.com/ztes/snowflake.io/issues"},"blog":"https://ztes.com","dist":{"shasum":"e0ebb15beed85776dbbec66fce8a47d9682cbd61","tarball":"https://registry.npmjs.org/snowflake.io/-/snowflake.io-2.1.2.tgz","fileCount":17,"integrity":"sha512-/E4K6HaIY3vwJrMI8t6OzLh8mSXdosnwGJVRwGZrjixr+zmo3azKuYnZWJEkWTUz3e+qzBrua7wmNzry5j1P4Q==","signatures":[{"sig":"MEYCIQDDYy4HC3DpFV2I7cP367B+EWi7on/JALcw0v0RN24PTgIhAMIRrWrIIN5wNC+t8lNHFW7kikUjP9v7ckhjmWakN6vt","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":57789},"main":"./lib/index.js","type":"module","types":"./lib/index.d.ts","module":"./lib/index.js","engines":{"node":">=14.0.0"},"exports":{".":{"types":"./lib/index.d.ts","import":"./lib/index.js","require":"./lib/index.js"},"./package.json":"./package.json"},"gitHead":"809540e26ae5671b12cc80a6a6f2e2f7d87643bf","scripts":{"dev":"set NODE_ENV=development && tsc --watch","test":"node lib/test.js","build":"tsc","create":"tsc","publish":"npm publish --access=public","build:pkg":"rm -rf lib && tsc","eslint:fix":"eslint --fix ./","test:example":"node src/distributed-example.mjs"},"_npmUser":{"name":"ztes","email":"xy@ztes.com"},"repository":{"url":"git+https://github.com/ztes/snowflake.io.git","type":"git"},"_npmVersion":"10.9.3","description":"High-performance distributed unique ID generator based on Twitter's Snowflake algorithm. Supports ESM and CommonJS with BigInt for precision.","directories":{},"_nodeVersion":"22.19.0","dependencies":{"bigint-conversion":"^2.4.3"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.39.1","rollup":"^4.53.2","core-js":"^3.46.0","prettier":"^3.6.2","@types/qs":"^6.14.0","typescript":"^5.9.3","@babel/core":"^7.28.5","@types/node":"^24.10.1","@babel/preset-env":"^7.28.5","rollup-plugin-dts":"^6.2.3","@types/webpack-env":"^1.18.8","rollup-plugin-copy":"^3.5.0","@rollup/plugin-json":"^6.1.0","@rollup/plugin-babel":"^6.1.0","eslint-define-config":"^2.1.0","rollup-plugin-eslint":"^7.0.0","rollup-plugin-terser":"^7.0.2","rollup-plugin-uglify":"^6.0.4","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4","rollup-plugin-commonjs":"^10.1.0","@rollup/plugin-commonjs":"^29.0.0","rollup-plugin-typescript":"^1.0.1","@typescript-eslint/parser":"^8.46.4","rollup-plugin-typescript2":"^0.36.0","rollup-plugin-node-resolve":"^5.2.0","@rollup/plugin-node-resolve":"^16.0.3","@typescript-eslint/eslint-plugin":"^8.46.4"},"_npmOperationalInternal":{"tmp":"tmp/snowflake.io_2.1.2_1763026923636_0.9821121330360427","host":"s3://npm-registry-packages-npm-production"}},"2.1.3":{"name":"snowflake.io","version":"2.1.3","keywords":["snowflake","snowflake.io","snowflake-id","snowflake id","flake-id","unique-id","distributed","distributed-systems","id-generator","unique-id-generator","distributed-id","twitter-snowflake","bigint","typescript","esm","commonjs","cjs","nodejs","browser","microservices","k-ordered","clock-drift","clock-skew","high-performance","scalable","uuid-alternative","雪花算法","雪花id","分布式id","唯一id","分布式系统","id生成器","后端","backend"],"author":{"name":"ztes.com","email":"xy@ztes.com"},"license":"MIT","_id":"snowflake.io@2.1.3","maintainers":[{"name":"ztes","email":"xy@ztes.com"}],"homepage":"https://github.com/ztes/snowflake.io#readme","bugs":{"url":"https://github.com/ztes/snowflake.io/issues"},"blog":"https://ztes.com","dist":{"shasum":"ea81927420d59015c734b7f539ab9f45a27d30a0","tarball":"https://registry.npmjs.org/snowflake.io/-/snowflake.io-2.1.3.tgz","fileCount":15,"integrity":"sha512-9o9VQY6C+ylE1A+UVGnRUvl5YVu6IO2DYw94L3Tbr338So/h2x9xNeDDfSuOiKUKCLorAGrUYCHwx6s6C1VQug==","signatures":[{"sig":"MEYCIQCg38A8L0QVI8GX2/VwSbCc/NHilqn9HebSjdv9LqMGSAIhALkzObu1PUwzBo/HHjBMqh0L7KuKqbLWnDlJw7Tah2Sq","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":61290},"main":"./lib/index.js","type":"module","types":"./lib/index.d.ts","module":"./lib/index.js","engines":{"node":">=14.0.0"},"exports":{".":{"types":"./lib/index.d.ts","import":"./lib/index.js","require":"./lib/index.js"},"./package.json":"./package.json"},"gitHead":"3fd8595f53a7d08535b846783fb6c8a019a341f1","scripts":{"dev":"set NODE_ENV=development && tsc --watch","test":"node test/comprehensive-test.js","build":"tsc && node scripts/fix-esm-imports.cjs","create":"tsc","publish":"npm publish --access=public","build:pkg":"rm -rf lib && tsc","eslint:fix":"eslint --fix ./","test:threads":"node test/multi-thread-example-esm.mjs","test:examples":"node test/usage-examples.js"},"_npmUser":{"name":"ztes","email":"xy@ztes.com"},"repository":{"url":"git+https://github.com/ztes/snowflake.io.git","type":"git"},"_npmVersion":"10.9.3","description":"High-performance distributed unique ID generator based on Twitter's Snowflake algorithm. Supports ESM and CommonJS with BigInt for precision.","directories":{},"_nodeVersion":"22.19.0","dependencies":{"bigint-conversion":"^2.4.3"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.39.1","rollup":"^4.53.2","core-js":"^3.46.0","prettier":"^3.6.2","@types/qs":"^6.14.0","typescript":"^5.9.3","@babel/core":"^7.28.5","@types/node":"^24.10.1","@babel/preset-env":"^7.28.5","rollup-plugin-dts":"^6.2.3","@types/webpack-env":"^1.18.8","rollup-plugin-copy":"^3.5.0","@rollup/plugin-json":"^6.1.0","@rollup/plugin-babel":"^6.1.0","eslint-define-config":"^2.1.0","rollup-plugin-eslint":"^7.0.0","rollup-plugin-terser":"^7.0.2","rollup-plugin-uglify":"^6.0.4","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4","rollup-plugin-commonjs":"^10.1.0","@rollup/plugin-commonjs":"^29.0.0","rollup-plugin-typescript":"^1.0.1","@typescript-eslint/parser":"^8.46.4","rollup-plugin-typescript2":"^0.36.0","rollup-plugin-node-resolve":"^5.2.0","@rollup/plugin-node-resolve":"^16.0.3","@typescript-eslint/eslint-plugin":"^8.46.4"},"_npmOperationalInternal":{"tmp":"tmp/snowflake.io_2.1.3_1763956606257_0.6006540393274429","host":"s3://npm-registry-packages-npm-production"}},"2.1.4":{"name":"snowflake.io","version":"2.1.4","keywords":["snowflake","snowflake.io","snowflake-id","snowflake id","flake-id","unique-id","distributed","distributed-systems","id-generator","unique-id-generator","distributed-id","twitter-snowflake","bigint","typescript","esm","commonjs","cjs","nodejs","browser","microservices","k-ordered","clock-drift","clock-skew","high-performance","scalable","uuid-alternative","雪花算法","雪花id","分布式id","唯一id","分布式系统","id生成器","后端","backend"],"author":{"name":"ztes.com","email":"xy@ztes.com"},"license":"MIT","_id":"snowflake.io@2.1.4","maintainers":[{"name":"ztes","email":"xy@ztes.com"}],"homepage":"https://github.com/ztes/snowflake.io#readme","bugs":{"url":"https://github.com/ztes/snowflake.io/issues"},"blog":"https://ztes.com","dist":{"shasum":"3c873134371773b6589cdc01d04c964201962c50","tarball":"https://registry.npmjs.org/snowflake.io/-/snowflake.io-2.1.4.tgz","fileCount":11,"integrity":"sha512-FgH3/LVzyVIIu5mPpvVTeCLi/WmaSN433QT4aifC8K3Tx1j23zDL6IV/+HTDZC4dOWxgEbzrMsiMkTs+1/1zcw==","signatures":[{"sig":"MEUCICLVlzDcXqBzpJ3K/IfxyLEt2LtX7M1EgzSAyYDeJvIHAiEAw4KV3sSR/VYQ2pxT2vaHOPMv0KuBP/8OC5Wrd0Wl0jM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":47395},"main":"./lib/index.js","type":"module","types":"./lib/index.d.ts","module":"./lib/index.js","engines":{"node":">=14.0.0"},"exports":{".":{"types":"./lib/index.d.ts","import":"./lib/index.js","require":"./lib/index.js"},"./package.json":"./package.json"},"gitHead":"522966df74de151715dcfceb8aa21163cb4d0711","scripts":{"dev":"set NODE_ENV=development && tsc --watch","test":"node test/comprehensive-test.js","build":"tsc && node scripts/fix-esm-imports.cjs","create":"tsc","publish":"npm publish --access=public","build:pkg":"rm -rf lib && tsc","eslint:fix":"eslint --fix ./","test:threads":"node test/multi-thread-example-esm.mjs","test:examples":"node test/usage-examples.js"},"_npmUser":{"name":"ztes","email":"xy@ztes.com"},"repository":{"url":"git+https://github.com/ztes/snowflake.io.git","type":"git"},"_npmVersion":"10.9.3","description":"High-performance distributed unique ID generator based on Twitter's Snowflake algorithm. Supports ESM and CommonJS with BigInt for precision.","directories":{},"_nodeVersion":"22.19.0","dependencies":{"bigint-conversion":"^2.4.3"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.39.1","rollup":"^4.53.2","core-js":"^3.46.0","prettier":"^3.6.2","@types/qs":"^6.14.0","typescript":"^5.9.3","@babel/core":"^7.28.5","@types/node":"^24.10.1","@babel/preset-env":"^7.28.5","rollup-plugin-dts":"^6.2.3","@types/webpack-env":"^1.18.8","rollup-plugin-copy":"^3.5.0","@rollup/plugin-json":"^6.1.0","@rollup/plugin-babel":"^6.1.0","eslint-define-config":"^2.1.0","rollup-plugin-eslint":"^7.0.0","rollup-plugin-terser":"^7.0.2","rollup-plugin-uglify":"^6.0.4","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4","rollup-plugin-commonjs":"^10.1.0","@rollup/plugin-commonjs":"^29.0.0","rollup-plugin-typescript":"^1.0.1","@typescript-eslint/parser":"^8.46.4","rollup-plugin-typescript2":"^0.36.0","rollup-plugin-node-resolve":"^5.2.0","@rollup/plugin-node-resolve":"^16.0.3","@typescript-eslint/eslint-plugin":"^8.46.4"},"_npmOperationalInternal":{"tmp":"tmp/snowflake.io_2.1.4_1763964556356_0.3772007067208618","host":"s3://npm-registry-packages-npm-production"}},"2.1.5":{"name":"snowflake.io","version":"2.1.5","keywords":["snowflake","snowflake.io","snowflake-id","snowflake id","flake-id","unique-id","distributed","distributed-systems","id-generator","unique-id-generator","distributed-id","twitter-snowflake","bigint","typescript","esm","commonjs","cjs","nodejs","browser","microservices","k-ordered","clock-drift","clock-skew","high-performance","scalable","uuid-alternative","雪花算法","雪花id","分布式id","唯一id","分布式系统","id生成器","后端","backend"],"author":{"name":"ztes.com","email":"xy@ztes.com"},"license":"MIT","_id":"snowflake.io@2.1.5","maintainers":[{"name":"ztes","email":"xy@ztes.com"}],"homepage":"https://github.com/ztes/snowflake.io#readme","bugs":{"url":"https://github.com/ztes/snowflake.io/issues"},"blog":"https://ztes.com","dist":{"shasum":"4e33ed4189350d959115475b689a9cb9f2d0cfd6","tarball":"https://registry.npmjs.org/snowflake.io/-/snowflake.io-2.1.5.tgz","fileCount":11,"integrity":"sha512-yqKDOwjaC+N2KopAH8FzuHzDXGOW8pS26akIkp2dsSABWnHj+a8uzzcf3Fr72b52w+p71Lxnkzj5tBXYQSx40Q==","signatures":[{"sig":"MEQCIBZ+vztODsKT0/g8bAUTM21B7OFfnVg3tLMxrXX259iQAiALt8ChmioEi4w4vatrQDK+JPT56vDCmcTENa64lC2gUQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":47376},"main":"./lib/index.js","type":"module","types":"./lib/index.d.ts","module":"./lib/index.js","engines":{"node":">=14.0.0"},"exports":{".":{"types":"./lib/index.d.ts","import":"./lib/index.js","require":"./lib/index.js"},"./package.json":"./package.json"},"gitHead":"522966df74de151715dcfceb8aa21163cb4d0711","scripts":{"dev":"set NODE_ENV=development && tsc --watch","test":"node test/comprehensive-test.js","build":"tsc && node scripts/fix-esm-imports.cjs","create":"tsc","publish":"npm publish --access=public","build:pkg":"rm -rf lib && tsc","eslint:fix":"eslint --fix ./","test:threads":"node test/multi-thread-example-esm.mjs","test:examples":"node test/usage-examples.js"},"_npmUser":{"name":"ztes","email":"xy@ztes.com"},"repository":{"url":"git+https://github.com/ztes/snowflake.io.git","type":"git"},"_npmVersion":"10.9.3","description":"High-performance distributed unique ID generator based on Twitter's Snowflake algorithm. Supports ESM and CommonJS with BigInt for precision.","directories":{},"_nodeVersion":"22.19.0","dependencies":{"bigint-conversion":"^2.4.3"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.39.1","rollup":"^4.53.2","core-js":"^3.46.0","prettier":"^3.6.2","@types/qs":"^6.14.0","typescript":"^5.9.3","@babel/core":"^7.28.5","@types/node":"^24.10.1","@babel/preset-env":"^7.28.5","rollup-plugin-dts":"^6.2.3","@types/webpack-env":"^1.18.8","rollup-plugin-copy":"^3.5.0","@rollup/plugin-json":"^6.1.0","@rollup/plugin-babel":"^6.1.0","eslint-define-config":"^2.1.0","rollup-plugin-eslint":"^7.0.0","rollup-plugin-terser":"^7.0.2","rollup-plugin-uglify":"^6.0.4","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4","rollup-plugin-commonjs":"^10.1.0","@rollup/plugin-commonjs":"^29.0.0","rollup-plugin-typescript":"^1.0.1","@typescript-eslint/parser":"^8.46.4","rollup-plugin-typescript2":"^0.36.0","rollup-plugin-node-resolve":"^5.2.0","@rollup/plugin-node-resolve":"^16.0.3","@typescript-eslint/eslint-plugin":"^8.46.4"},"_npmOperationalInternal":{"tmp":"tmp/snowflake.io_2.1.5_1763964870196_0.4670036966815827","host":"s3://npm-registry-packages-npm-production"}},"3.0.0":{"name":"snowflake.io","version":"3.0.0","keywords":["snowflake","snowflake-id","unique-id","distributed","id-generator","distributed-id","twitter-snowflake","bigint","typescript","esm","nodejs","microservices","high-performance","cluster","uuid-alternative","雪花算法","雪花id","分布式id"],"author":{"name":"ztes.com","email":"xy@ztes.com"},"license":"MIT","_id":"snowflake.io@3.0.0","maintainers":[{"name":"ztes","email":"xy@ztes.com"}],"homepage":"https://github.com/ztes/snowflake.io#readme","bugs":{"url":"https://github.com/ztes/snowflake.io/issues"},"dist":{"shasum":"ffd5f9ae82ec3c01d5888d1912481acbd911ad30","tarball":"https://registry.npmjs.org/snowflake.io/-/snowflake.io-3.0.0.tgz","fileCount":23,"integrity":"sha512-t3K+51ZJkAdcOQt74AnmDBRYOeobe7DP9cgJnroNB2Pg1rb7quRiO7zvZjXSLhYlZUv4yaRwpLMJXkCUaJ/nVg==","signatures":[{"sig":"MEUCIG3TsHY7BcH1bSsBLABleK6JN6LflsuMUysmiocwPup0AiEA5NjCKJLGnWb++OBnLWmOEp8Oz4J+UMu2bJfIi/R0pmg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":92300},"main":"./lib/index.js","type":"module","types":"./lib/index.d.ts","module":"./lib/index.js","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./lib/index.d.ts","import":"./lib/index.js"},"./package.json":"./package.json"},"gitHead":"50e43e6000a59d3e3bd9df7fe3dc036212a57ac3","scripts":{"dev":"tsc --watch","lint":"eslint src/","test":"node lib/test.js","build":"rm -rf lib && tsc","lint:fix":"eslint src/ --fix","test:example":"node src/distributed-example.mjs","prepublishOnly":"pnpm run build"},"_npmUser":{"name":"ztes","email":"xy@ztes.com"},"repository":{"url":"git+https://github.com/ztes/snowflake.io.git","type":"git"},"_npmVersion":"11.9.0","description":"High-performance distributed unique ID generator based on Twitter's Snowflake algorithm. Production-ready with BigInt precision, async support, and cluster-safe.","directories":{},"_nodeVersion":"24.14.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/snowflake.io_3.0.0_1774405120069_0.928029898948447","host":"s3://npm-registry-packages-npm-production"}},"4.0.0":{"name":"snowflake.io","version":"4.0.0","keywords":["snowflake","snowflake-id","unique-id","distributed","id-generator","distributed-id","twitter-snowflake","bigint","typescript","esm","nodejs","microservices","high-performance","cluster","uuid-alternative","雪花算法","雪花id","分布式id"],"author":{"name":"ztes.com","email":"xy@ztes.com"},"license":"MIT","_id":"snowflake.io@4.0.0","maintainers":[{"name":"ztes","email":"xy@ztes.com"}],"homepage":"https://github.com/ztes/snowflake.io#readme","bugs":{"url":"https://github.com/ztes/snowflake.io/issues"},"dist":{"shasum":"1fa99f2e2a9469d257c2b94e66ae71a5090a7ff4","tarball":"https://registry.npmjs.org/snowflake.io/-/snowflake.io-4.0.0.tgz","fileCount":23,"integrity":"sha512-+E8v2z6KlvRv/XxmaqeC5rxXGU/HExNvD5wFTIh7sDOC+eHlydQfj81cds57p0nVaD6iD0xYjbsXa+cdQLLwag==","signatures":[{"sig":"MEUCIQDB5yy3Zhp+ahrPBwwRUb8LJLE6CO4wVJRp+TPbxW25XgIgZJUmGZmmqePpWUCnu3IEemc+AVPfBae87F+a0tvAH80=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":110642},"main":"./lib/index.js","type":"module","types":"./lib/index.d.ts","module":"./lib/index.js","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./lib/index.d.ts","import":"./lib/index.js"},"./package.json":"./package.json"},"gitHead":"50e43e6000a59d3e3bd9df7fe3dc036212a57ac3","scripts":{"dev":"tsc --watch","lint":"eslint src/","test":"node lib/test.js","build":"rm -rf lib && tsc","lint:fix":"eslint src/ --fix","test:example":"node src/distributed-example.mjs","prepublishOnly":"pnpm run build"},"_npmUser":{"name":"ztes","email":"xy@ztes.com"},"repository":{"url":"git+https://github.com/ztes/snowflake.io.git","type":"git"},"_npmVersion":"11.9.0","description":"High-performance distributed unique ID generator based on Twitter's Snowflake algorithm. Production-ready with BigInt precision, async support, and cluster-safe.","directories":{},"_nodeVersion":"24.14.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/snowflake.io_4.0.0_1774581368515_0.6964471272047252","host":"s3://npm-registry-packages-npm-production"}},"4.0.1":{"name":"snowflake.io","version":"4.0.1","keywords":["snowflake","snowflake-id","unique-id","distributed","id-generator","distributed-id","twitter-snowflake","bigint","typescript","esm","nodejs","microservices","high-performance","cluster","uuid-alternative","雪花算法","雪花id","分布式id"],"author":{"name":"ztes.com","email":"xy@ztes.com"},"license":"MIT","_id":"snowflake.io@4.0.1","maintainers":[{"name":"ztes","email":"xy@ztes.com"}],"homepage":"https://github.com/ztes/snowflake.io#readme","bugs":{"url":"https://github.com/ztes/snowflake.io/issues"},"dist":{"shasum":"54c408d8911f5d272fbb8c7fa56952de5508da29","tarball":"https://registry.npmjs.org/snowflake.io/-/snowflake.io-4.0.1.tgz","fileCount":24,"integrity":"sha512-ahQLcR+JJ5jFO79yVPfpqCVUbVS3bwutmN+07tzrUZt0Eu508Onq8WdrWG9HduPyWRnIG95geF2Dd+0EYcFT2w==","signatures":[{"sig":"MEQCIH3zneb7Nn8LvtAqRBXs7B1oAsZZMKRvfoJOyop7LPgBAiBFluuEBqI5oodnK7krpKYmXWjUXBFqaKATqX6Kc+z0VQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":89579},"main":"./lib/index.js","type":"module","types":"./lib/index.d.ts","module":"./lib/index.js","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./lib/index.d.ts","import":"./lib/index.js"},"./package.json":"./package.json"},"gitHead":"5998bd5663dd55c99a7aad4adc2497e4faa7a2d3","scripts":{"dev":"tsc --watch","lint":"eslint src/","test":"node lib/test.js","build":"rm -rf lib && tsc","lint:fix":"eslint src/ --fix","test:example":"node src/distributed-example.mjs","prepublishOnly":"pnpm run build"},"_npmUser":{"name":"ztes","email":"xy@ztes.com"},"repository":{"url":"git+https://github.com/ztes/snowflake.io.git","type":"git"},"_npmVersion":"11.9.0","description":"High-performance distributed unique ID generator based on Twitter's Snowflake algorithm. Production-ready with BigInt precision, async support, and cluster-safe.","directories":{},"_nodeVersion":"24.14.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/snowflake.io_4.0.1_1774582731380_0.14802375989293126","host":"s3://npm-registry-packages-npm-production"}},"4.1.1":{"name":"snowflake.io","version":"4.1.1","keywords":["snowflake","snowflake-id","unique-id","distributed","id-generator","distributed-id","twitter-snowflake","bigint","typescript","esm","nodejs","microservices","high-performance","cluster","uuid-alternative","雪花算法","雪花id","分布式id"],"author":{"name":"ztes.com","email":"xy@ztes.com"},"license":"MIT","_id":"snowflake.io@4.1.1","maintainers":[{"name":"ztes","email":"xy@ztes.com"}],"homepage":"https://github.com/ztes/snowflake.io#readme","bugs":{"url":"https://github.com/ztes/snowflake.io/issues"},"dist":{"shasum":"3623181c7ad960de6f1260ac7fac9764da026f95","tarball":"https://registry.npmjs.org/snowflake.io/-/snowflake.io-4.1.1.tgz","fileCount":24,"integrity":"sha512-/D8NwW6pb0bckkdvkMuDXHEtcGBz/VmaSj16XYOxJRCV+EBccV/mHt69VwlVcD93DazcBuXxxyntLjAcbImwFA==","signatures":[{"sig":"MEUCIQCaVXkbccJ1WJ4rbng0XZKxphm01Q68QoMkSF0v17NduwIgJPn3UxMS2vORmQ5UgYGOeqpu6olUuRxpgJeQuLhNyek=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":133505},"main":"./lib/index.js","type":"module","types":"./lib/index.d.ts","module":"./lib/index.js","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./lib/index.d.ts","import":"./lib/index.js"},"./package.json":"./package.json"},"gitHead":"c5a6f88a90da2e0c635a8e03144d86292e7844b0","scripts":{"dev":"tsc --watch","lint":"eslint src/","test":"node lib/test.js","build":"rm -rf lib && tsc","lint:fix":"eslint src/ --fix","test:example":"node src/distributed-example.mjs","prepublishOnly":"pnpm run build"},"_npmUser":{"name":"ztes","email":"xy@ztes.com"},"repository":{"url":"git+https://github.com/ztes/snowflake.io.git","type":"git"},"_npmVersion":"11.9.0","description":"High-performance distributed unique ID generator based on Twitter's Snowflake algorithm. Production-ready with BigInt precision, async support, and cluster-safe.","directories":{},"_nodeVersion":"24.14.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/snowflake.io_4.1.1_1774589648662_0.5175721728294407","host":"s3://npm-registry-packages-npm-production"}},"4.1.2":{"name":"snowflake.io","version":"4.1.2","type":"module","main":"./lib/index.js","module":"./lib/index.js","description":"High-performance distributed unique ID generator based on Twitter's Snowflake algorithm. Production-ready with BigInt precision, async support, and cluster-safe.","scripts":{"build":"rm -rf lib && tsc","dev":"tsc --watch","test":"node lib/test.js","test:example":"node src/distributed-example.mjs","lint":"eslint src/","lint:fix":"eslint src/ --fix","prepublishOnly":"pnpm run build"},"exports":{".":{"import":"./lib/index.js","types":"./lib/index.d.ts"},"./package.json":"./package.json"},"types":"./lib/index.d.ts","repository":{"type":"git","url":"git+https://github.com/ztes/snowflake.io.git"},"bugs":{"url":"https://github.com/ztes/snowflake.io/issues"},"author":{"name":"ztes.com","email":"xy@ztes.com"},"homepage":"https://github.com/ztes/snowflake.io#readme","keywords":["snowflake","snowflake-id","unique-id","distributed","id-generator","distributed-id","twitter-snowflake","bigint","typescript","esm","nodejs","microservices","high-performance","cluster","uuid-alternative","雪花算法","雪花id","分布式id"],"license":"MIT","devDependencies":{"@types/node":"^22.0.0","typescript":"^5.0.0"},"engines":{"node":">=16.0.0"},"gitHead":"2c57e285be171dd06407e73facc46649aa9c1f49","_id":"snowflake.io@4.1.2","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-Z7fLmVvUlNUffBlGMtIN+5EAi/4gpulM9Os4CjgB+HppP7Pvxwl22O+QmyhIzlg7PAbAVGZdJo3HG1bvMu2d6Q==","shasum":"41d1cceaaa1b0256f6926a4bf1340ca621beefc2","tarball":"https://registry.npmjs.org/snowflake.io/-/snowflake.io-4.1.2.tgz","fileCount":16,"unpackedSize":117425,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHd93Eb3br14SJnCpJJykO5lHxGDeDt49MBKPdTn70UTAiEA4vY8m4TPXbjkj8UZJi2i3yhzogR6Ck32xsrW45BgqMA="}]},"_npmUser":{"name":"ztes","email":"xy@ztes.com"},"directories":{},"maintainers":[{"name":"ztes","email":"xy@ztes.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/snowflake.io_4.1.2_1779872330977_0.10906429488309977"},"_hasShrinkwrap":false}},"time":{"created":"2024-06-29T08:12:25.518Z","modified":"2026-05-27T08:58:51.251Z","0.0.0-alpha.1":"2024-06-29T08:12:25.889Z","0.0.0-alpha.2":"2024-06-29T08:18:20.297Z","0.0.0-alpha.3":"2024-06-29T08:33:47.155Z","0.0.1":"2025-05-08T06:11:20.716Z","0.0.0-alpha.4":"2025-05-08T06:18:22.445Z","0.0.0-alpha.5":"2025-05-08T06:34:36.978Z","0.0.0-alpha.6":"2025-05-08T06:45:26.597Z","0.0.0-alpha.7":"2025-05-08T07:24:29.198Z","0.0.0-alpha.8":"2025-05-08T07:37:50.711Z","1.0.0":"2025-05-08T07:43:19.260Z","2.0.0":"2025-11-13T08:09:12.801Z","2.0.1":"2025-11-13T08:28:32.000Z","2.1.1":"2025-11-13T08:44:18.842Z","2.0.2":"2025-11-13T08:53:06.893Z","2.1.0":"2025-11-13T09:30:05.185Z","2.1.2":"2025-11-13T09:42:03.963Z","2.1.3":"2025-11-24T03:56:46.452Z","2.1.4":"2025-11-24T06:09:16.539Z","2.1.5":"2025-11-24T06:14:30.385Z","3.0.0":"2026-03-25T02:18:40.213Z","4.0.0":"2026-03-27T03:16:08.665Z","4.0.1":"2026-03-27T03:38:51.542Z","4.1.1":"2026-03-27T05:34:08.800Z","4.1.2":"2026-05-27T08:58:51.118Z"},"bugs":{"url":"https://github.com/ztes/snowflake.io/issues"},"author":{"name":"ztes.com","email":"xy@ztes.com"},"license":"MIT","homepage":"https://github.com/ztes/snowflake.io#readme","keywords":["snowflake","snowflake-id","unique-id","distributed","id-generator","distributed-id","twitter-snowflake","bigint","typescript","esm","nodejs","microservices","high-performance","cluster","uuid-alternative","雪花算法","雪花id","分布式id"],"repository":{"type":"git","url":"git+https://github.com/ztes/snowflake.io.git"},"description":"High-performance distributed unique ID generator based on Twitter's Snowflake algorithm. Production-ready with BigInt precision, async support, and cluster-safe.","maintainers":[{"name":"ztes","email":"xy@ztes.com"}],"readme":"# Snowflake.io v4.1.2\n\n![npm](https://img.shields.io/npm/v/snowflake.io)\n![license](https://img.shields.io/npm/l/snowflake.io)\n\nHigh-performance distributed unique ID generator for production environments.  \n高性能分布式雪花 ID 生成器，专为 Node.js 生产环境设计。\n\n完整英文文档请查看 [README.EN.md](./README.EN.md)\n\n## Features / 特性\n\n- 🚀 **High Performance** - 高性能，单机可达到 5,000,000+ IDs/second\n- 🔒 **Thread Safe** - 线程安全，内置并发保护机制，适用于并发场景\n- ⚡ **Async Support** - 异步支持，提供完整异步 API，适合高并发环境\n- 🌐 **Cluster Ready** - 集群就绪，支持生产环境显式节点身份配置\n- 🛡️ **Clock Skew Handling** - 时钟回拨处理，支持 `throw` / `wait` / `auto_adjust` 三种策略\n- 📊 **Monitoring** - 监控统计，内置运行时统计信息，便于生产监控\n- 💎 **BigInt Precision** - BigInt 精度安全，避免 JavaScript Number 精度问题\n- 🧭 **Node Utilities** - 节点工具，内置节点 ID 编码 / 解码辅助方法\n\n## Installation / 安装\n\n```bash\npnpm add snowflake.io\n```\n\n## Quick Start / 快速开始\n\n```typescript\nimport {\n  composeNodeId,\n  decomposeNodeId,\n  generateId,\n  generateIds,\n  parseId,\n  isValidId,\n} from 'snowflake.io'\n\n// 生成单个 ID\nconst nodeId = composeNodeId(1, 1)\nconst id = generateId({ id: nodeId })\n// '824443173089710080'\n\n// 批量生成\nconst ids = generateIds(100, { datacenter: 1, worker: 2 })\n\n// 解析 ID\nconst parts = parseId(id, { datacenter: 1, worker: 1 })\n// { timestamp: 1774399369878, nodeId: 33, sequence: 0, epoch: 1577836800000 }\n\n// 校验 ID\nisValidId(id) // true\n\n// 解码节点 ID\ndecomposeNodeId(nodeId)\n// { nodeId: 33, datacenter: 1, worker: 1 }\n```\n\n## Production First / 生产优先\n\n从 `v4.0` 开始，`snowflake.io` 默认采用更安全的生产策略：\n\n- 必须显式传入 `id` 或 `datacenter + worker`\n- 不再默认根据 `process.pid` 自动分配节点 ID\n- `id`、`datacenter`、`worker` 超范围时直接抛错，不再静默截断\n\n如果你只是在本地开发或测试环境临时调试，可以显式开启不安全自动节点模式：\n\n```typescript\ngenerateId({ allowUnsafeAutoNodeId: true })\n```\n\n请不要在生产环境使用 `allowUnsafeAutoNodeId`。\n\n## 快速上手：多机 / Node.js Cluster / PM2 Cluster\n\n如果你是第一次在生产环境接 `snowflake.io`，最推荐的做法不是直接传 `id`，而是统一使用：\n\n- 每台机器一个 `datacenter`\n- 每个进程一个 `worker`\n\n也就是：\n\n```text\nnodeId = (datacenter << 5) | worker\n```\n\n这样最容易排查，也最符合 Node.js 多机、多进程部署习惯。\n\n### 1. 单机单进程\n\n适合：\n\n- 一台机器只跑一个 Node.js 进程\n- 本地开发环境\n- 小型服务\n\n配置：\n\n```bash\nSNOWFLAKE_DATACENTER_ID=1\nSNOWFLAKE_WORKER_ID=0\n```\n\n使用：\n\n```typescript\nimport { generateId } from 'snowflake.io'\n\nconst id = generateId({\n  datacenter: Number(process.env.SNOWFLAKE_DATACENTER_ID),\n  worker: Number(process.env.SNOWFLAKE_WORKER_ID),\n})\n```\n\n### 2. 多机部署\n\n适合：\n\n- 2 台或更多机器\n- 每台机器上可能还有多个 Node.js 进程\n\n配置原则：\n\n- 每台机器 `SNOWFLAKE_DATACENTER_ID` 必须不同\n- 同一台机器内每个进程 `worker` 必须不同\n\n示例：\n\n```text\n机器 A: SNOWFLAKE_DATACENTER_ID=1\n机器 B: SNOWFLAKE_DATACENTER_ID=2\n机器 C: SNOWFLAKE_DATACENTER_ID=3\n```\n\n如果每台机器只跑一个进程，那么所有机器都可以用：\n\n```bash\nSNOWFLAKE_WORKER_ID=0\n```\n\n### 3. PM2 Cluster 模式\n\n这是 Node.js 里最省心的生产接法之一。\n\nPM2 会自动给每个实例注入 `NODE_APP_INSTANCE`，你可以直接把它当成 `worker`：\n\n```bash\nSNOWFLAKE_DATACENTER_ID=2\nNODE_APP_INSTANCE=0\n```\n\n代码：\n\n```typescript\nimport { generateId } from 'snowflake.io'\n\nconst datacenter = Number(process.env.SNOWFLAKE_DATACENTER_ID)\nconst worker = Number(process.env.NODE_APP_INSTANCE ?? '0')\n\nconst id = generateId({\n  datacenter,\n  worker,\n  clockSkewHandler: 'wait',\n  maxClockSkewWait: 100,\n})\n```\n\n推荐的 PM2 `ecosystem.config.js` 示例：\n\n```javascript\nmodule.exports = {\n  apps: [\n    {\n      name: 'snowflake-demo',\n      script: './dist/main.js',\n      exec_mode: 'cluster',\n      instances: 4,\n      env: {\n        SNOWFLAKE_DATACENTER_ID: '2',\n        SNOWFLAKE_CLOCK_SKEW_HANDLER: 'wait',\n        SNOWFLAKE_MAX_CLOCK_SKEW_WAIT: '100',\n      },\n    },\n  ],\n}\n```\n\n说明：\n\n- PM2 会给 4 个实例分别注入 `NODE_APP_INSTANCE=0/1/2/3`\n- 你不需要手工给每个实例分别写 `worker`\n- 只要单机实例数不超过 `32`，这套方式就可以直接用\n\n### 4. Node.js Cluster 模式\n\n如果你直接使用 `node:cluster`，推荐把 `cluster.worker.id - 1` 当作 `worker`：\n\n```typescript\nimport cluster from 'node:cluster'\nimport { generateId } from 'snowflake.io'\n\nconst datacenter = Number(process.env.SNOWFLAKE_DATACENTER_ID)\nconst worker =\n  cluster.isWorker && cluster.worker\n    ? cluster.worker.id - 1\n    : 0\n\nconst id = generateId({\n  datacenter,\n  worker,\n  clockSkewHandler: 'wait',\n  maxClockSkewWait: 100,\n})\n```\n\n原因是 `cluster.worker.id` 通常从 `1` 开始，而雪花 `worker` 需要从 `0` 开始。\n\n### 5. 最推荐的封装方式\n\n最省心的做法，是在应用启动时统一解析配置，然后整个进程只复用这一套配置。\n\n```typescript\nimport cluster from 'node:cluster'\nimport { generateId, type SnowflakeOptions } from 'snowflake.io'\n\nfunction resolveSnowflakeOptions(): SnowflakeOptions {\n  const directNodeId = process.env.SNOWFLAKE_NODE_ID\n\n  if (directNodeId !== undefined && directNodeId !== '') {\n    return {\n      id: Number(directNodeId),\n      clockSkewHandler: 'wait',\n      maxClockSkewWait: 100,\n    }\n  }\n\n  const datacenter = process.env.SNOWFLAKE_DATACENTER_ID\n  if (datacenter === undefined || datacenter === '') {\n    throw new Error(\n      'Missing snowflake node config. Set SNOWFLAKE_NODE_ID or SNOWFLAKE_DATACENTER_ID.',\n    )\n  }\n\n  const workerFromPm2 = process.env.NODE_APP_INSTANCE\n  const workerFromEnv = process.env.SNOWFLAKE_WORKER_ID\n  const workerFromCluster =\n    cluster.isWorker && cluster.worker ? String(cluster.worker.id - 1) : undefined\n\n  const worker = Number(workerFromEnv ?? workerFromPm2 ?? workerFromCluster ?? '0')\n\n  if (worker < 0 || worker > 31) {\n    throw new Error(`worker must be between 0 and 31, got ${worker}`)\n  }\n\n  return {\n    datacenter: Number(datacenter),\n    worker,\n    clockSkewHandler: 'wait',\n    maxClockSkewWait: 100,\n  }\n}\n\nconst snowflakeOptions = resolveSnowflakeOptions()\n\nexport function nextId() {\n  return generateId(snowflakeOptions)\n}\n```\n\n这段代码的好处是：\n\n- 单机时直接用 `SNOWFLAKE_WORKER_ID`\n- PM2 时自动优先读取 `NODE_APP_INSTANCE`\n- `node:cluster` 时自动回退到 `cluster.worker.id - 1`\n- 如果节点配置缺失，进程会直接启动失败，而不是悄悄带病运行\n\n### 6. 什么时候应该直接传 `id`\n\n以下场景更适合直接传 10 位 `id`：\n\n- 你已经有中心化节点分配服务\n- 你跑在弹性容器环境里，节点位置不稳定\n- 单机进程数可能超过 `32`\n\n例如：\n\n```bash\nSNOWFLAKE_NODE_ID=513\n```\n\n```typescript\ngenerateId({ id: Number(process.env.SNOWFLAKE_NODE_ID) })\n```\n\n### 7. 你拿到库后最少需要记住的规则\n\n```text\n1. 生产环境必须显式配置节点身份\n2. 每台机器 datacenter 唯一\n3. 同机每个进程 worker 唯一\n4. 单机 worker 最多 32 个\n5. 推荐 clockSkewHandler='wait' + maxClockSkewWait=100\n6. 不要在生产环境使用 allowUnsafeAutoNodeId\n```\n\n## ID Structure / ID结构\n\n```text\n| 符号位(1) | 时间戳(41) | 节点ID(10) | 序列号(12) |\n```\n\n| 组成部分 | 位数 | 范围 | 说明 |\n|----------|------|------|------|\n| 符号位 | 1 | 0 | 固定为 0 |\n| 时间戳 | 41 | 约 69 年 | 相对 epoch 的毫秒差 |\n| 节点 ID | 10 | 0-1023 | 最多 1024 个节点 |\n| 序列号 | 12 | 0-4095 | 每毫秒最多 4096 个 ID |\n\n## Options / 配置项\n\n| 配置项 | 类型 | 范围 / 默认值 | 说明 |\n|--------|------|----------------|------|\n| `id` | `number \\| bigint` | `0-1023` | 直接指定 10 位节点 ID，会覆盖 `datacenter/worker` |\n| `datacenter` | `number` | `0-31` | 节点 ID 高 5 位 |\n| `worker` | `number` | `0-31` | 节点 ID 低 5 位 |\n| `allowUnsafeAutoNodeId` | `boolean` | `false` | 仅用于开发 / 测试，生产环境不建议使用 |\n| `epoch` | `number` | `2020-01-01 UTC` | 自定义纪元时间戳（毫秒） |\n| `clockSkewHandler` | `'throw' \\| 'wait' \\| 'auto_adjust'` | `'wait'` | 时钟回拨处理策略 |\n| `maxClockSkewWait` | `number` | `5000` | 回拨等待的最大时长 |\n\n## API Reference / API文档\n\n### 常用函数用途速查\n\n| 函数 | 它是干什么的 | 什么时候用 |\n|------|--------------|------------|\n| `generateId(options?)` | 生成一个雪花 ID（同步） | 最常用，普通业务代码里直接生成单个 ID |\n| `generateIdAsync(options?)` | 异步生成一个雪花 ID | 高并发或异步流程里生成单个 ID |\n| `generateIds(count, options?)` | 一次生成多个雪花 ID（同步） | 需要批量生成 ID，且希望减少重复调用开销 |\n| `generateIdsAsync(count, options?)` | 一次异步生成多个雪花 ID | 批量生成且在异步场景中使用 |\n| `parseId(id, options?)` | 把一个雪花 ID 解析成时间戳、节点 ID、序列号等信息 | 排查问题、追踪 ID 来源、根据 ID 反推生成时间 |\n| `isValidId(id, options?)` | 判断一个值是不是合法雪花 ID | 接口入参校验、导入数据校验、风控检查 |\n| `composeNodeId(datacenter, worker)` | 把 `datacenter + worker` 组合成一个 10 位节点 ID | 你想先分配数据中心和工作节点，再得到最终 `nodeId` 时使用 |\n| `decomposeNodeId(nodeId)` | 把一个 10 位节点 ID 反向解析为 `datacenter + worker` | 你拿到 `nodeId` 后，想知道它属于哪个数据中心、哪个进程 |\n| `getNodeInfo(options?)` | 直接返回当前配置对应的节点信息 `{ nodeId, datacenter, worker }` | 启动日志打印、健康检查、调试当前实例配置 |\n| `Snowflake.getStats(options?)` | 返回当前实例统计信息，如序列号、时钟回拨次数、总生成量 | 监控、告警、运行时观察 |\n\n### 一个最容易理解的例子\n\n假设你有下面这组配置：\n\n```typescript\nconst datacenter = 1\nconst worker = 5\n```\n\n那几个容易混淆的函数分别是：\n\n```typescript\nimport {\n  composeNodeId,\n  decomposeNodeId,\n  getNodeInfo,\n} from 'snowflake.io'\n\nconst nodeId = composeNodeId(datacenter, worker)\n// 作用：把 datacenter=1 和 worker=5 组合成一个 nodeId\n// 结果：37\n\nconst parts = decomposeNodeId(nodeId)\n// 作用：把 nodeId=37 再拆回 datacenter 和 worker\n// 结果：{ nodeId: 37, datacenter: 1, worker: 5 }\n\nconst current = getNodeInfo({ datacenter: 1, worker: 5 })\n// 作用：直接告诉你“这套配置对应的节点信息是什么”\n// 结果：{ nodeId: 37, datacenter: 1, worker: 5 }\n```\n\n### 快速参考\n\n| 函数 | 返回类型 | 说明 |\n|------|----------|------|\n| `generateId(options?)` | `string` | 生成单个 ID（同步） |\n| `generateIdAsync(options?)` | `Promise<string>` | 生成单个 ID（异步） |\n| `generateIds(count, options?)` | `string[]` | 批量生成 ID（同步） |\n| `generateIdsAsync(count, options?)` | `Promise<string[]>` | 批量生成 ID（异步） |\n| `parseId(id, options?)` | `SnowflakeDeconstructed` | 解析 ID 结构 |\n| `isValidId(id, options?)` | `boolean` | 验证 ID 有效性 |\n| `composeNodeId(datacenter, worker)` | `number` | 编码 10 位节点 ID |\n| `decomposeNodeId(nodeId)` | `SnowflakeNodeInfo` | 解码 10 位节点 ID |\n| `getNodeInfo(options?)` | `SnowflakeNodeInfo` | 获取节点信息 |\n\n---\n\n### 函数详解\n\n#### generateId(options?)\n\n生成单个雪花 ID，同步方式。\n\n```typescript\nimport { generateId } from 'snowflake.io'\n\n// 指定节点ID\nconst id = generateId({ id: 100 })\n\n// 指定数据中心和工作节点\nconst id2 = generateId({ datacenter: 1, worker: 5 })\n// nodeId = (datacenter << 5) | worker = 37\n\n// 自定义纪元\nconst id3 = generateId({\n  datacenter: 1,\n  worker: 5,\n  epoch: new Date('2024-01-01').getTime(),\n})\n\n// 开发环境才允许自动节点ID\nconst devOnlyId = generateId({ allowUnsafeAutoNodeId: true })\n```\n\n#### generateIdAsync(options?)\n\n异步生成单个 ID，推荐在高并发场景使用。\n\n```typescript\nimport { generateIdAsync } from 'snowflake.io'\n\n// 异步生成\nconst id = await generateIdAsync({ id: 1 })\n\n// 并发生成多个ID\nconst promises = Array.from({ length: 100 }, () =>\n  generateIdAsync({ id: 1 }),\n)\nconst ids = await Promise.all(promises)\n// 所有ID唯一，无阻塞\n```\n\n#### generateIds(count, options?)\n\n批量生成 ID，性能更优。\n\n```typescript\nimport { generateIds } from 'snowflake.io'\n\n// 批量生成100个ID\nconst ids = generateIds(100, { datacenter: 1, worker: 1 })\n// ['824443173089710080', '824443173089710081', ...]\n\n// 限制：最多10000个\nconst manyIds = generateIds(10000, { datacenter: 1, worker: 1 })\n```\n\n#### generateIdsAsync(count, options?)\n\n异步批量生成，适合大规模生成。\n\n```typescript\nimport { generateIdsAsync } from 'snowflake.io'\n\n// 异步批量生成\nconst ids = await generateIdsAsync(5000, { id: 1 })\nconsole.log(ids.length) // 5000\n```\n\n#### composeNodeId(datacenter, worker)\n\n将 `datacenter + worker` 编码为 10 位节点 ID。\n\n```typescript\nimport { composeNodeId } from 'snowflake.io'\n\nconst nodeId = composeNodeId(2, 7)\n// 71\n```\n\n#### decomposeNodeId(nodeId)\n\n将 10 位节点 ID 解析回 `datacenter + worker`。\n\n```typescript\nimport { decomposeNodeId } from 'snowflake.io'\n\ndecomposeNodeId(71)\n// { nodeId: 71, datacenter: 2, worker: 7 }\n```\n\n#### parseId(id, options?)\n\n解析 ID，提取时间戳、节点 ID、序列号。\n\n```typescript\nimport { parseId } from 'snowflake.io'\n\nconst id = '824443173089710080'\nconst parts = parseId(id, { datacenter: 1, worker: 1 })\n\nconsole.log(parts)\n// {\n//   timestamp: 1774399369878,    // 生成时的Unix时间戳(ms)\n//   nodeId: 33,                  // 节点ID\n//   sequence: 0,                 // 序列号\n//   epoch: 1577836800000         // 使用的纪元\n// }\n\n// 转换为日期\nconst date = new Date(parts.timestamp)\n// 2026-03-25T00:42:49.878Z\n\n// 计算ID年龄\nconst age = Date.now() - parts.timestamp\nconsole.log(`ID生成于 ${age}ms 前`)\n```\n\n#### isValidId(id, options?)\n\n验证 ID 是否有效。\n\n```typescript\nimport { isValidId } from 'snowflake.io'\n\nisValidId('824443173089710080')  // true\nisValidId('')                     // false\nisValidId('-1')                   // false\nisValidId('abc')                  // false\nisValidId('99999999999999999999') // false (时间戳在未来)\n```\n\n#### getNodeInfo(options?)\n\n获取当前实例的节点信息。\n\n```typescript\nimport { getNodeInfo } from 'snowflake.io'\n\nconst nodeInfo = getNodeInfo({ datacenter: 1, worker: 5 })\n// { nodeId: 37, datacenter: 1, worker: 5 }\n```\n\n---\n\n### Snowflake 类方法\n\n除了便捷函数，还可以使用 `Snowflake` 类的静态方法：\n\n```typescript\nimport { Snowflake } from 'snowflake.io'\n```\n\n#### Snowflake.generate(options?)\n\n生成 Buffer 格式的 ID（8 字节）。\n\n```typescript\nconst buffer = Snowflake.generate({ id: 1 })\n// <Buffer 0b 71 08 b5 a8 00 10 00>\n\n// Buffer 长度固定为 8 字节\nconsole.log(buffer.length) // 8\n\n// 转换为十六进制字符串\nbuffer.toString('hex') // '0b7108b5a8001000'\n```\n\n#### Snowflake.generateId(options?)\n\n同 `generateId()` 函数。\n\n```typescript\nconst id = Snowflake.generateId({ id: 1 })\n```\n\n#### Snowflake.generateIdAsync(options?)\n\n同 `generateIdAsync()` 函数。\n\n```typescript\nconst id = await Snowflake.generateIdAsync({ id: 1 })\n```\n\n#### Snowflake.generateIds(count, options?)\n\n同 `generateIds()` 函数。\n\n```typescript\nconst ids = Snowflake.generateIds(100, { id: 1 })\n```\n\n#### Snowflake.generateIdsAsync(count, options?)\n\n同 `generateIdsAsync()` 函数。\n\n```typescript\nconst ids = await Snowflake.generateIdsAsync(100, { id: 1 })\n```\n\n#### Snowflake.deconstruct(id, options?)\n\n同 `parseId()` 函数，支持多种输入格式。\n\n```typescript\n// 字符串\nSnowflake.deconstruct('824443173089710080', { id: 1 })\n\n// BigInt\nSnowflake.deconstruct(824443173089710080n, { id: 1 })\n\n// Buffer\nconst buffer = Snowflake.generate({ id: 1 })\nSnowflake.deconstruct(buffer, { id: 1 })\n```\n\n#### Snowflake.validate(id, options?)\n\n同 `isValidId()` 函数。\n\n```typescript\nSnowflake.validate('824443173089710080', { id: 1 }) // true\n```\n\n#### Snowflake.getNodeInfo(options?)\n\n获取当前实例的节点信息。\n\n```typescript\nconst nodeInfo = Snowflake.getNodeInfo({ datacenter: 1, worker: 5 })\n// { nodeId: 37, datacenter: 1, worker: 5 }\n```\n\n#### Snowflake.getNodeId(options?)\n\n获取当前配置的节点 ID。\n\n```typescript\nconst nodeId = Snowflake.getNodeId({ datacenter: 1, worker: 5 })\nconsole.log(nodeId) // 37\n\n// 开发环境自动分配的节点ID\nconst autoNodeId = Snowflake.getNodeId({ allowUnsafeAutoNodeId: true })\nconsole.log(autoNodeId)\n```\n\n#### Snowflake.getStats(options?)\n\n获取实例统计信息，用于监控。\n\n```typescript\nconst stats = Snowflake.getStats({ datacenter: 1, worker: 1 })\n\nconsole.log(stats)\n// {\n//   nodeId: 33,                 // 当前节点ID\n//   datacenter: 1,              // 数据中心ID\n//   worker: 1,                  // 工作节点ID\n//   epoch: 1577836800000,       // 纪元时间\n//   lastTimestamp: 1774399369878, // 最后生成ID的时间戳\n//   sequence: 1,                // 当前序列号\n//   maxSequence: 4095,          // 最大序列号\n//   maxNodeId: 1023,            // 最大节点ID\n//   maxDatacenterId: 31,        // 最大数据中心ID\n//   maxWorkerId: 31,            // 最大工作节点ID\n//   clockBackwardsCount: 0,     // 时钟回拨次数\n//   totalGenerated: 100,        // 总共生成的ID数量\n//   clockSkewHandler: 'wait',   // 当前时钟策略\n//   maxClockSkewWait: 5000,     // 最大等待时间\n//   autoNodeId: false           // 是否自动节点模式\n// }\n```\n\n**监控示例**：\n\n```typescript\n// 定期监控时钟回拨\nsetInterval(() => {\n  const stats = Snowflake.getStats({ id: 1 })\n\n  if (stats.clockBackwardsCount > 0) {\n    console.warn(`⚠️ 检测到时钟回拨! 次数: ${stats.clockBackwardsCount}`)\n    // 发送告警\n    sendAlert({\n      type: 'clock_skew',\n      nodeId: stats.nodeId,\n      count: stats.clockBackwardsCount,\n    })\n  }\n\n  // 监控ID生成速率\n  console.log(`总生成: ${stats.totalGenerated}, 最后时间戳: ${stats.lastTimestamp}`)\n}, 60000)\n```\n\n---\n\n### 配置选项详解\n\n```typescript\ninterface SnowflakeOptions {\n  id?: number | bigint\n  datacenter?: number\n  worker?: number\n  allowUnsafeAutoNodeId?: boolean\n  epoch?: number\n  clockSkewHandler?: 'throw' | 'wait' | 'auto_adjust'\n  maxClockSkewWait?: number\n}\n```\n\n#### 节点ID配置方式\n\n```typescript\n// 方式1: 直接指定节点ID (推荐)\ngenerateId({ id: 100 })\n\n// 方式2: 数据中心 + 工作节点\ngenerateId({ datacenter: 1, worker: 5 })\n// nodeId = (1 << 5) | 5 = 37\n\n// 方式3: 开发环境临时自动分配（不要用于生产）\ngenerateId({ allowUnsafeAutoNodeId: true })\n```\n\n#### 纪元配置\n\n```typescript\n// 默认纪元: 2020-01-01 00:00:00 UTC\ngenerateId({ datacenter: 1, worker: 1 })\n\n// 自定义纪元\ngenerateId({\n  datacenter: 1,\n  worker: 1,\n  epoch: new Date('2024-01-01T00:00:00Z').getTime(),\n})\n\n// 注意: 纪元不能在未来，也不能太早（会导致时间戳溢出）\n```\n\n---\n\n### 类型定义\n\n```typescript\ntype SnowflakeIdInput = string | Buffer | bigint\n\ninterface SnowflakeDeconstructed {\n  timestamp: number\n  nodeId: number\n  sequence: number\n  epoch: number\n}\n\ninterface SnowflakeNodeInfo {\n  nodeId: number\n  datacenter: number\n  worker: number\n}\n\ninterface SnowflakeStats extends SnowflakeNodeInfo {\n  epoch: number\n  lastTimestamp: number\n  sequence: number\n  maxSequence: number\n  maxNodeId: number\n  maxDatacenterId: number\n  maxWorkerId: number\n  clockBackwardsCount: number\n  totalGenerated: number\n  clockSkewHandler: 'throw' | 'wait' | 'auto_adjust'\n  maxClockSkewWait: number\n  autoNodeId: boolean\n}\n```\n\n## Clock Skew Strategies / 时钟回拨策略\n\n| 策略 | 行为说明 | 适用场景 |\n|------|----------|----------|\n| `throw` | 检测到时钟回拨后立即抛错 | 强一致性、严格环境 |\n| `wait` | 等待时钟追上后继续生成（默认） | 通用生产环境 |\n| `auto_adjust` | 直接沿用上一次时间戳 | 高可用优先场景 |\n\n```typescript\n// 严格模式：检测到回拨立即报错\ngenerateId({ id: 1, clockSkewHandler: 'throw' })\n\n// 等待模式：最多等待 5 秒\ngenerateId({ id: 1, clockSkewHandler: 'wait', maxClockSkewWait: 5000 })\n\n// 自动调整：沿用上一次时间戳继续生成\ngenerateId({ id: 1, clockSkewHandler: 'auto_adjust' })\n```\n\n---\n\n## 🌐 Cluster Deployment / 集群部署最佳实践\n\n### 核心原则\n\n```text\n┌─────────────────────────────────────────────────────────────┐\n│  雪花ID集群部署三要素                                       │\n├─────────────────────────────────────────────────────────────┤\n│  1. 节点ID唯一 - 每个实例必须有不同的 nodeId (0-1023)      │\n│  2. 时钟同步   - 所有节点使用 NTP 保持时间同步              │\n│  3. 纪元一致   - 所有节点使用相同的 epoch                  │\n└─────────────────────────────────────────────────────────────┘\n```\n\n### 方案一：Node.js Cluster / PM2 Cluster（推荐）\n\n```typescript\nimport cluster from 'node:cluster'\nimport { generateId } from 'snowflake.io'\n\nconst datacenter = Number(process.env.SNOWFLAKE_DATACENTER_ID ?? 1)\n\nconst worker =\n  process.env.NODE_APP_INSTANCE !== undefined\n    ? Number(process.env.NODE_APP_INSTANCE)\n    : cluster.isWorker\n      ? cluster.worker.id - 1\n      : 0\n\nconst id = generateId({\n  datacenter,\n  worker,\n  clockSkewHandler: 'wait',\n  maxClockSkewWait: 100,\n})\n```\n\n### 方案二：Kubernetes StatefulSet（推荐）\n\n```yaml\napiVersion: apps/v1\nkind: StatefulSet\nmetadata:\n  name: id-generator\nspec:\n  serviceName: id-generator\n  replicas: 5\n```\n\n```typescript\nconst podOrdinal = parseInt(process.env.POD_ORDINAL || '0')\n\nconst id = generateId({\n  datacenter: 0,\n  worker: podOrdinal,\n})\n```\n\n### 方案三：数据库分配节点ID\n\n```sql\nCREATE TABLE node_registry (\n  id INT AUTO_INCREMENT PRIMARY KEY,\n  node_id INT UNIQUE,\n  hostname VARCHAR(255),\n  ip VARCHAR(45),\n  last_heartbeat TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n  INDEX idx_node_id (node_id)\n);\n```\n\n### 方案四：Redis 分布式锁分配\n\n```typescript\nimport Redis from 'ioredis'\n\nclass RedisNodeManager {\n  private redis = new Redis('redis://localhost:6379')\n  // 启动时分配 nodeId，关闭时释放\n}\n```\n\n### 多数据中心架构\n\n```typescript\nconst DATACENTER_CONFIG = {\n  beijing: { code: 1, timezone: 'Asia/Shanghai' },\n  shanghai: { code: 2, timezone: 'Asia/Shanghai' },\n  singapore: { code: 8, timezone: 'Asia/Singapore' },\n}\n\nconst datacenter = DATACENTER_CONFIG[process.env.DATACENTER || 'beijing'].code\nconst worker = parseInt(process.env.WORKER_ID || '0')\n\nconst id = generateId({ datacenter, worker })\nconst parts = parseId(id)\nconst dc = parts.nodeId >> 5\nconst wk = parts.nodeId & 0x1f\n```\n\n### 监控与告警\n\n```typescript\nimport { Snowflake } from 'snowflake.io'\n\nclass SnowflakeMonitor {\n  private lastTotal = 0\n  private lastTime = Date.now()\n\n  start() {\n    setInterval(() => {\n      const stats = Snowflake.getStats({ id: this.getNodeId() })\n\n      const now = Date.now()\n      const rate = (stats.totalGenerated - this.lastTotal) / ((now - this.lastTime) / 1000)\n      this.lastTotal = stats.totalGenerated\n      this.lastTime = now\n\n      if (stats.clockBackwardsCount > 0) {\n        this.sendAlert('clock_skew', {\n          nodeId: stats.nodeId,\n          count: stats.clockBackwardsCount,\n          severity: 'high',\n        })\n      }\n\n      this.recordMetrics({\n        nodeId: stats.nodeId,\n        totalGenerated: stats.totalGenerated,\n        ratePerSecond: rate,\n        clockBackwardsCount: stats.clockBackwardsCount,\n      })\n    }, 60000)\n  }\n}\n```\n\n### 检查清单\n\n| 检查项 | 说明 | 验证方法 |\n|--------|------|----------|\n| ✅ 节点ID唯一 | 每个实例 nodeId 不同 | `Snowflake.getNodeId()` |\n| ✅ 时钟同步 | NTP 服务正常运行 | `ntpq -p` 或 `timedatectl status` |\n| ✅ 纪元一致 | 所有节点使用相同 epoch | `Snowflake.getStats().epoch` |\n| ✅ 监控告警 | clockBackwardsCount 监控 | 定期检查 `getStats()` |\n| ✅ 优雅关闭 | 释放节点ID资源 | `process.on('SIGTERM')` |\n| ✅ 容量规划 | 节点数 < 1024 | 预留扩容空间 |\n\n---\n\n## 🎯 Advanced Topics / 进阶话题\n\n### Clock Skew Handling Deep Dive / 时钟回拨深度解析\n\n#### 什么是时钟回拨？\n\n时钟回拨指系统时间向后跳变，常见原因：\n\n| 原因 | 说明 | 风险等级 |\n|------|------|----------|\n| NTP 同步 | 网络时间协议校正时钟 | 🟡 中等 |\n| 手动调整 | 运维人员手动修改时间 | 🔴 高 |\n| 虚拟机迁移 | VM 暂停后恢复 | 🟡 中等 |\n| 时区切换 | 夏令时调整 | 🟢 低 |\n\n#### 时钟回拨的风险\n\n```text\n时间线:  t1 → t2 → t3 → t2(回拨) → t4\nID生成:  ID1 ID2 ID3  ID4(可能重复!)\n```\n\n如果回拨后使用相同时间戳 + 相同节点ID，可能生成重复 ID。\n\n#### 三种策略的选择指南\n\n```typescript\n// 场景1: 金融交易系统 - 数据一致性优先\ngenerateId({ id: 1, clockSkewHandler: 'throw' })\n\n// 场景2: 电商订单系统 - 平衡可用性和一致性\ngenerateId({\n  id: 1,\n  clockSkewHandler: 'wait',\n  maxClockSkewWait: 5000,\n})\n\n// 场景3: 日志系统 - 可用性优先\ngenerateId({ id: 1, clockSkewHandler: 'auto_adjust' })\n```\n\n### Big Tech Solutions / 大厂解决方案\n\n#### Twitter 原始方案\n\nTwitter 作为雪花算法的发明者，采用“唯一节点分配 + 时钟偏差检测”的组合思路。\n\n#### 百度 UidGenerator\n\n特点：\n\n- 时间戳使用秒级，延长有效期\n- Worker ID 位数更大，支持更多节点\n- RingBuffer 预生成 ID，提升性能\n\n#### 美团 Leaf\n\n特点：\n\n- Segment 模式适合数据库号段\n- Snowflake 模式适合分布式节点\n- 常见做法是通过外部系统管理 Worker ID\n\n#### Sony Sonyflake\n\n特点：\n\n- 时间精度 10ms\n- 节点位更大\n- 更适合低频、长周期系统\n\n### Production Tips / 生产环境技巧\n\n#### 1. Epoch 选择策略\n\n```typescript\n// ✅ 推荐：显式配置 epoch\nconst projectEpoch = new Date('2024-01-01').getTime()\nconst id = generateId({ datacenter: 1, worker: 1, epoch: projectEpoch })\n```\n\n#### 2. 节点ID分配最佳实践\n\n```typescript\n// 方案A: 环境变量配置（推荐）\nconst nodeId = parseInt(process.env.NODE_ID || '0')\ngenerateId({ id: nodeId })\n\n// 方案B: 数据库分配\nasync function allocateNodeId() {\n  const result = await db.query(\n    'INSERT INTO node_registry (hostname, ip) VALUES (?, ?) RETURNING id',\n    [os.hostname(), getLocalIP()],\n  )\n  return result.id % 1024\n}\n```\n\n#### 3. 高并发场景优化\n\n```typescript\n// ❌ 错误：循环调用同步API\nfor (let i = 0; i < 10000; i++) {\n  ids.push(generateId({ datacenter: 1, worker: 1 }))\n}\n\n// ✅ 正确：使用批量API\nconst ids = generateIds(10000, { datacenter: 1, worker: 1 })\n\n// ✅ 更好：异步并发\nconst ids = await generateIdsAsync(10000, { datacenter: 1, worker: 1 })\n```\n\n#### 4. ID 解析与追踪\n\n```typescript\nfunction traceId(id: string) {\n  const parts = parseId(id)\n  return {\n    generatedAt: new Date(parts.timestamp),\n    datacenter: parts.nodeId >> 5,\n    worker: parts.nodeId & 0x1f,\n    sequence: parts.sequence,\n    age: Date.now() - parts.timestamp,\n  }\n}\n```\n\n#### 5. 容量规划\n\n```typescript\nfunction calculateCapacity(nodes: number) {\n  const idsPerMs = 4096\n  const idsPerSecond = idsPerMs * 1000 * nodes\n  const idsPerDay = idsPerSecond * 86400\n  const idsPerYear = idsPerDay * 365\n\n  return {\n    perSecond: idsPerSecond,\n    perDay: idsPerDay,\n    perYear: idsPerYear,\n  }\n}\n```\n\n---\n\n## ❓ FAQ / 常见问题\n\n### Q1: 为什么使用 BigInt 而不是 Number？\n\n**A**: JavaScript Number 类型最大安全整数是 `2^53 - 1 = 9007199254740991`，而雪花 ID 可能超过这个值。使用 BigInt 可以避免精度丢失。\n\n### Q2: 时钟回拨时应该选择哪种策略？\n\n**A**: 根据业务场景选择：\n\n| 业务场景 | 推荐策略 | 理由 |\n|----------|----------|------|\n| 金融交易 | `throw` | 数据一致性优先 |\n| 订单系统 | `wait` | 平衡可用性和一致性 |\n| 日志系统 | `auto_adjust` | 可用性优先 |\n| 消息队列 | `auto_adjust` | 允许轻微乱序 |\n\n### Q3: 节点ID用完了怎么办？\n\n**A**: 10 位节点 ID 支持 1024 个节点，如果不够：\n\n```typescript\n// 方案1: 多层ID分配\n// datacenter(5位) * worker(5位) * 实例序号(外部管理)\n\n// 方案2: 动态分配 + 回收\n// 节点下线后回收ID\n\n// 方案3: 按业务拆分不同ID系统\n```\n\n### Q4: 如何保证跨数据中心的ID唯一性？\n\n**A**: 使用 `datacenter + worker` 组合：\n\n```typescript\ngenerateId({ datacenter: 1, worker: 1 }) // 北京\ngenerateId({ datacenter: 1, worker: 2 }) // 北京 worker 2\ngenerateId({ datacenter: 8, worker: 1 }) // 新加坡\n```\n\n### Q5: ID可以排序吗？\n\n**A**: 雪花 ID 是**大致有序**的：\n\n```text\n✅ 按时间大致递增（可用于时间范围查询）\n✅ 同一节点内严格递增\n⚠️ 跨节点可能乱序（不同节点同一毫秒生成的ID）\n```\n\n```typescript\nconst ids = generateIds(100, { datacenter: 1, worker: 1 })\nconst sorted = [...ids].sort()\n```\n\n### Q6: 如何处理ID耗尽？\n\n**A**: 每毫秒 4096 个 ID，单节点每秒可生成 409.6 万个 ID。如果不够：\n\n```typescript\n// 方案1: 增加节点数\n\n// 方案2: 使用异步API批量预生成\nconst preGeneratedIds = await generateIdsAsync(100000, { datacenter: 1, worker: 1 })\n\n// 方案3: 序列号溢出时等待下一毫秒\n```\n\n### Q7: 如何在数据库中存储雪花ID？\n\n**A**: 推荐使用 `VARCHAR(20)` 或 `BIGINT UNSIGNED`。\n\n#### 方案1: VARCHAR(20) 字符串存储（推荐）\n\n```sql\nCREATE TABLE orders (\n  id VARCHAR(20) PRIMARY KEY,\n  created_at TIMESTAMP\n)\n```\n\n```typescript\nimport { generateId } from 'snowflake.io'\n\nconst id = generateId({ datacenter: 1, worker: 1 })\nawait db.query('INSERT INTO orders (id) VALUES (?)', [id])\n```\n\n#### 方案2: BIGINT UNSIGNED 数值存储\n\n```sql\nCREATE TABLE orders (\n  id BIGINT UNSIGNED PRIMARY KEY,\n  created_at TIMESTAMP\n)\n```\n\n```typescript\nconst id = generateId({ datacenter: 1, worker: 1 })\nawait db.query('INSERT INTO orders (id) VALUES (?)', [id])\n\nconst idBigInt = BigInt(generateId({ datacenter: 1, worker: 1 }))\nawait db.query('INSERT INTO orders (id) VALUES (?)', [idBigInt])\n```\n\n### Q8: 雪花ID vs UUID 如何选择？\n\n| 特性 | 雪花ID | UUID |\n|------|--------|------|\n| 长度 | 18-19位 | 36字符 |\n| 有序性 | 大致有序 | 无序 |\n| 索引效率 | 高 | 低 |\n| 可解析 | 时间+节点 | 无 |\n| 分布式 | 需要协调 | 无需协调 |\n| 适用场景 | 数据库主键 / 业务流水号 | 临时标识 |\n\n---\n\n## Performance / 性能\n\n```text\nBenchmark / 基准环境（MacBook Pro M1）:\n- Generate 10,000 IDs: 2-3ms\n- Per ID: 0.0002ms\n- Throughput: 3,000,000+ IDs/second\n- Memory: < 1MB for 10,000 IDs\n```\n\n## Migration from v2.x / 从v2.x迁移\n\n```typescript\n// v2.x\nimport { generateSnowflakeId } from 'snowflake.io'\n\n// v4.0\nimport { generateId } from 'snowflake.io'\n```\n\n## License / 许可证\n\nMIT\n","readmeFilename":"README.md"}