{"_id":"@deciosfernandes/uuidv7-timestamp","_rev":"3-0ef7b6a4edd1124a83b22af03d5572c3","name":"@deciosfernandes/uuidv7-timestamp","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@deciosfernandes/uuidv7-timestamp","version":"0.1.0","keywords":["uuid","uuidv7","timestamp","typescript","angular"],"author":{"name":"deciosfernandes"},"license":"MIT","_id":"@deciosfernandes/uuidv7-timestamp@0.1.0","maintainers":[{"name":"deciosfernandes","email":"gatofki@gmail.com"}],"homepage":"https://github.com/deciosfernandes/uuidv7-timestamp#readme","bugs":{"url":"https://github.com/deciosfernandes/uuidv7-timestamp/issues"},"dist":{"shasum":"ddb2855d649fad22ec607ab16acf5b5841dadbba","tarball":"https://registry.npmjs.org/@deciosfernandes/uuidv7-timestamp/-/uuidv7-timestamp-0.1.0.tgz","fileCount":9,"integrity":"sha512-GC4JLbnk/NJaqddZUHd6PV90ByKcZ9WyX/e5zUQq/Emq5Zp8gh3RxatPM9UcV3Pdn73RJ5D6a6QVdQFgXgrsrA==","signatures":[{"sig":"MEQCIE53mDF5KT7sUhYrzyvhi9cxRP4HhOr+bKGdJ2P3t2ccAiBUQDW2nEtaVJiCMyHePar3HIipZUjIax3F/gLkg4uQtg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20376},"main":"dist/index.cjs.js","types":"dist/index.d.ts","module":"dist/index.esm.js","gitHead":"72645aa9447d2298f9fb06a81a2f114ed330f5ee","scripts":{"lint":"eslint . --ext .ts","test":"vitest","build":"tsc && rollup -c","clean":"rm -rf dist .turbo cache","prepare":"npm run build"},"_npmUser":{"name":"deciosfernandes","email":"gatofki@gmail.com"},"repository":{"url":"git+https://github.com/deciosfernandes/uuidv7-timestamp.git","type":"git"},"_npmVersion":"10.9.3","description":"Extract epoch timestamp from UUID v7 strings (millis, Date, ISO) for TypeScript/Angular apps.","directories":{},"_nodeVersion":"22.19.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.0.0","rollup":"^3.0.0","vitest":"^1.3.0","typescript":"^5.0.0","@types/node":"^20.0.0","rollup-plugin-dts":"^5.0.0","@rollup/plugin-commonjs":"^24.0.0","@rollup/plugin-typescript":"^12.3.0","@typescript-eslint/parser":"^5.0.0","@rollup/plugin-node-resolve":"^15.0.0","@typescript-eslint/eslint-plugin":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/uuidv7-timestamp_0.1.0_1765451821837_0.2133713249973328","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@deciosfernandes/uuidv7-timestamp","version":"0.1.1","keywords":["uuid","uuidv7","timestamp","typescript","angular"],"author":{"name":"deciosfernandes"},"license":"MIT","_id":"@deciosfernandes/uuidv7-timestamp@0.1.1","maintainers":[{"name":"deciosfernandes","email":"gatofki@gmail.com"}],"homepage":"https://github.com/deciosfernandes/uuidv7-timestamp#readme","bugs":{"url":"https://github.com/deciosfernandes/uuidv7-timestamp/issues"},"dist":{"shasum":"c3449687b1c7bb70509995086d2295fadeaba236","tarball":"https://registry.npmjs.org/@deciosfernandes/uuidv7-timestamp/-/uuidv7-timestamp-0.1.1.tgz","fileCount":9,"integrity":"sha512-RA/Opr17y54IajWVWwCnax8NxMcNuwZKA6/1YyTF9bXpXLynZ094OWwHsgVVkvWmZaGT0PQvG95nZNJcXbnmYQ==","signatures":[{"sig":"MEUCIQDyoahTXsL+0Um/rZ+VexXX7mdD8nZOtT1mpEC5GJyZBQIge08vv/whCt0YgcN/nTqKFArsvCJ/TGN4fqFNkGXR5T4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20542},"main":"dist/index.cjs.js","type":"module","types":"dist/index.d.ts","module":"dist/index.esm.js","gitHead":"b640bc4529b7f3a804506b56ffb3714f3cc5845b","scripts":{"lint":"eslint . --ext .ts","test":"vitest","build":"tsc && rollup -c","clean":"rm -rf dist .turbo cache","prepare":"npm run build"},"_npmUser":{"name":"deciosfernandes","email":"gatofki@gmail.com"},"repository":{"url":"git+https://github.com/deciosfernandes/uuidv7-timestamp.git","type":"git"},"_npmVersion":"10.9.3","description":"Extract epoch timestamp from UUID v7 strings (millis, Date, ISO) for TypeScript/Angular apps.","directories":{},"_nodeVersion":"22.19.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.0.0","rollup":"^3.0.0","vitest":"^2.1.0","typescript":"^5.0.0","@types/node":"^20.0.0","rollup-plugin-dts":"^5.0.0","@rollup/plugin-commonjs":"^24.0.0","@rollup/plugin-typescript":"^12.3.0","@typescript-eslint/parser":"^5.0.0","@rollup/plugin-node-resolve":"^15.0.0","@typescript-eslint/eslint-plugin":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/uuidv7-timestamp_0.1.1_1765452078311_0.9752354947518382","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@deciosfernandes/uuidv7-timestamp","version":"0.1.2","description":"Extract epoch timestamp from UUID v7 strings (millis, Date, ISO) — works with any TypeScript or JavaScript project.","type":"module","main":"dist/index.cjs.js","module":"dist/index.esm.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.esm.js","require":"./dist/index.cjs.js"}},"sideEffects":false,"scripts":{"build":"rollup -c","clean":"rimraf dist .turbo cache","test":"vitest","lint":"eslint src test","prepare":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/deciosfernandes/uuidv7-timestamp.git"},"keywords":["uuid","uuid-v7","uuidv7","timestamp","extract","epoch","date","iso","typescript","javascript"],"author":{"name":"deciosfernandes"},"license":"MIT","engines":{"node":">=18"},"publishConfig":{"access":"public"},"devDependencies":{"@rollup/plugin-typescript":"^12.3.0","@types/node":"^22.0.0","eslint":"^9.0.0","rimraf":"^6.0.0","rollup":"^4.0.0","rollup-plugin-dts":"^6.0.0","tslib":"^2.8.0","typescript":"^5.0.0","typescript-eslint":"^8.0.0","vitest":"^3.0.0"},"gitHead":"77b92fce8bef991a5d2f99a199216790b96f90fb","_id":"@deciosfernandes/uuidv7-timestamp@0.1.2","bugs":{"url":"https://github.com/deciosfernandes/uuidv7-timestamp/issues"},"homepage":"https://github.com/deciosfernandes/uuidv7-timestamp#readme","_nodeVersion":"24.13.1","_npmVersion":"11.10.1","dist":{"integrity":"sha512-3TLTEYj+uwJrT8yDCl81Rds+ZesGATt1uoHuGlvaGEu2aLhVyhi/aAaNI6NqHlrPwptqeNNV/gjTzd7Tf778Wg==","shasum":"18e49a75136f074f986da63cd56c4a8d09b0a095","tarball":"https://registry.npmjs.org/@deciosfernandes/uuidv7-timestamp/-/uuidv7-timestamp-0.1.2.tgz","fileCount":8,"unpackedSize":18052,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDsqAx6PkF5Q76n7YwfUnwtZaUII2uA13qKPAop3YbapgIhAPvJY313zPSIytX1woQBZUowd7Uti/RPBU+Uy7QO+uox"}]},"_npmUser":{"name":"deciosfernandes","email":"gatofki@gmail.com"},"directories":{},"maintainers":[{"name":"deciosfernandes","email":"gatofki@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/uuidv7-timestamp_0.1.2_1772056170284_0.636535440792098"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-11T11:17:01.755Z","modified":"2026-02-25T21:49:30.825Z","0.1.0":"2025-12-11T11:17:02.009Z","0.1.1":"2025-12-11T11:21:18.437Z","0.1.2":"2026-02-25T21:49:30.426Z"},"bugs":{"url":"https://github.com/deciosfernandes/uuidv7-timestamp/issues"},"author":{"name":"deciosfernandes"},"license":"MIT","homepage":"https://github.com/deciosfernandes/uuidv7-timestamp#readme","keywords":["uuid","uuid-v7","uuidv7","timestamp","extract","epoch","date","iso","typescript","javascript"],"repository":{"type":"git","url":"git+https://github.com/deciosfernandes/uuidv7-timestamp.git"},"description":"Extract epoch timestamp from UUID v7 strings (millis, Date, ISO) — works with any TypeScript or JavaScript project.","maintainers":[{"name":"deciosfernandes","email":"gatofki@gmail.com"}],"readme":"# @deciosfernandes/uuidv7-timestamp\r\n\r\nExtract epoch timestamp from UUID v7 strings (TypeScript).\r\n\r\nThis tiny library extracts the timestamp encoded in UUID v7 values (the first 48 bits / first 12 hex chars) and returns it as milliseconds, a Date, or an ISO string.\r\n\r\n## Installation\r\n\r\nnpm:\r\n```bash\r\nnpm install @deciosfernandes/uuidv7-timestamp\r\n```\r\n\r\nyarn:\r\n```bash\r\nyarn add @deciosfernandes/uuidv7-timestamp\r\n```\r\n\r\n## Usage\r\n\r\n```ts\r\nimport { extractTimestampFromUuidV7, extractTimestampAsDate } from '@deciosfernandes/uuidv7-timestamp';\r\n\r\nconst uuid = '017f7f58-89ab-7000-8123-0123456789ab';\r\nconst millis = extractTimestampFromUuidV7(uuid);\r\nconst date = extractTimestampAsDate(uuid);\r\nconsole.log(millis, date.toISOString());\r\n```\r\n\r\n## API\r\n\r\n```ts\r\n// Returns epoch milliseconds encoded in the UUID v7\r\nextractTimestampFromUuidV7(uuid: string): number\r\n\r\n// Returns a Date instance\r\nextractTimestampAsDate(uuid: string): Date\r\n\r\n// Returns an ISO 8601 string (UTC)\r\nextractTimestampAsISOString(uuid: string): string\r\n```\r\n\r\n## Notes\r\n\r\n- The function validates the UUID format and ensures the version nibble is `7`. If the UUID is not v7, an Error is thrown.\r\n- The timestamp is assumed to be the first 48 bits of the UUID per the v7 draft layout.\r\n\r\n## License\r\n\r\nMIT","readmeFilename":"README.md"}