{"_id":"@aardpro/time-id","name":"@aardpro/time-id","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@aardpro/time-id","version":"1.0.0","description":"一个根据时间戳产生唯一id的方法，并且能够自定义后缀，用来取代uuid和数字自增id。A method that generates a unique id based on the current timestamp in milliseconds, and can also be used to generate a unique id with a suffix， which can be used to replace uuid and numeric auto-increment id","scripts":{"dev":"vite","build":"rimraf ./dist && tsc && vite build && ncp ./lib ./dist","test":"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage"},"repository":{"type":"git","url":"git+https://github.com/aardpro/time-id.git"},"keywords":["uuid","timestamp id","unique id","auto increment id","时间戳id","唯一id","自增id"],"author":{"name":"aardpro"},"license":"MIT","bugs":{"url":"https://github.com/aardpro/time-id/issues"},"homepage":"https://github.com/aardpro/time-id#readme","devDependencies":{"@eslint/js":"^9.14.0","@vitest/coverage-v8":"^2.1.8","eslint":"^9.14.0","globals":"^15.12.0","ncp":"^2.0.0","rimraf":"^6.0.1","typescript":"~5.6.2","typescript-eslint":"^8.13.0","vite":"^5.4.10","vitest":"^2.1.8"},"type":"module","private":false,"sideEffects":false,"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js"}},"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","_id":"@aardpro/time-id@1.0.0","gitHead":"67180299fb978e35ed58e4abd690704683c48c01","_nodeVersion":"22.19.0","_npmVersion":"11.6.0","dist":{"integrity":"sha512-hYkVCudsN9ELHKwTM2XqoRVbpXs+OEkTwh8Qv06TlACMp0Z+ibBKc75yH9Sg20v5oZQyh4svfh1/GH29exGpGQ==","shasum":"405fb96fcfa19860cdb5c3ad1d50f6d5d2f085c8","tarball":"https://registry.npmjs.org/@aardpro/time-id/-/time-id-1.0.0.tgz","fileCount":15,"unpackedSize":40972,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDy4P0nOPRDqow1aK1+J/PA3Ena4xoYWABKKN1m5IBoSAIhAIAXdUbk/r/OmDHYzFwW+Iy14alWJPhNMQ4Qk4UOewfY"}]},"_npmUser":{"name":"aardpro","email":"chileehong@outlook.com"},"directories":{},"maintainers":[{"name":"aardpro","email":"chileehong@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/time-id_1.0.0_1769331269729_0.2876227094447652"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-25T08:54:29.632Z","1.0.0":"2026-01-25T08:54:29.863Z","modified":"2026-01-25T08:54:30.112Z"},"maintainers":[{"name":"aardpro","email":"chileehong@outlook.com"}],"description":"一个根据时间戳产生唯一id的方法，并且能够自定义后缀，用来取代uuid和数字自增id。A method that generates a unique id based on the current timestamp in milliseconds, and can also be used to generate a unique id with a suffix， which can be used to replace uuid and numeric auto-increment id","homepage":"https://github.com/aardpro/time-id#readme","keywords":["uuid","timestamp id","unique id","auto increment id","时间戳id","唯一id","自增id"],"repository":{"type":"git","url":"git+https://github.com/aardpro/time-id.git"},"author":{"name":"aardpro"},"bugs":{"url":"https://github.com/aardpro/time-id/issues"},"license":"MIT","readme":"# @aardpro/time-id\r\n\r\n一个根据时间戳产生唯一ID的方法，并且能够自定义后缀，用来取代uuid和数字自增id。\r\n\r\nA method that generates a unique ID based on the current timestamp in milliseconds, with support for custom suffixes. Can be used to replace UUID and numeric auto-increment IDs.\r\n\r\n## [在线演示 | Playground](https://stackblitz.com/~/github.com/aardpro/time-id)\r\n\r\n## [中文文档](./lib/zh-CN.MD) | [English](./lib/en-US.MD)\r\n\r\n## Features\r\n\r\n- **Compact**: Only 7-10 characters typically, compared to UUID v4's 36 characters\r\n- **Roughly Sortable**: Based on timestamp, similar generation times produce similar IDs\r\n- **High Performance**: Uses base26 encoding (a-z), more compact than hexadecimal\r\n- **Flexible**: Supports custom suffix length and accumulator for distributed scenarios\r\n\r\n## Installation\r\n\r\n```bash\r\n# pnpm\r\npnpm i @aardpro/time-id\r\n\r\n# npm\r\nnpm i @aardpro/time-id\r\n\r\n# yarn\r\nyarn add @aardpro/time-id\r\n\r\n# bun\r\nbun i @aardpro/time-id\r\n```\r\n\r\n## Quick Start\r\n\r\n```ts\r\nimport { timeId } from '@aardpro/time-id';\r\n\r\nconst id = timeId();\r\n// Example output: 'lgskjwabc'\r\n// Format: {timestamp_base26}{3_char_suffix}\r\n```\r\n\r\n## Publishing to npm\r\n\r\nFor maintainers who want to publish this package:\r\n\r\n```bash\r\n# 1. Install dependencies\r\nnpm install\r\n\r\n# 2. Run tests\r\nnpm test\r\n\r\n# 3. Build the package\r\nnpm run build\r\n\r\n# 4. Check the dist directory\r\nls dist\r\n\r\n# 5. Login to npm (if not already logged in)\r\nnpm login\r\n\r\n# 6. Publish to npm (for scoped packages, use --access public)\r\nnpm publish --access public\r\n\r\n# 7. Or publish a beta version\r\nnpm publish --tag beta\r\n```\r\n\r\n**Note**: This package uses the scoped name `@aardpro/time-id`, which requires `--access public` flag during publish.\r\n\r\n## License\r\n\r\n[MIT](./LICENSE)\r\n","readmeFilename":"readme.MD","_rev":"1-ab12f4ae30aea6ca989a46bf1578e453"}