Generate, check, and parse unique IDs with tagged prefixes
Find a file
2025-07-18 10:44:27 -04:00
src 1.0.0 2025-07-18 10:32:49 -04:00
.gitignore Initial commit 2025-07-18 07:56:59 -04:00
bun.lock Initial commit 2025-07-18 07:56:59 -04:00
LICENSE 1.0.0 2025-07-18 10:32:49 -04:00
package.json Fix package.json 2025-07-18 10:44:27 -04:00
README.md Update readme 2025-07-18 10:39:10 -04:00
tsconfig.json 1.0.0 2025-07-18 10:32:49 -04:00

Tagged Identifiers

Generate, check, and parse unique identifiers with tagged prefixes. Identifiers are generated using nanoid.

Usage

import { taggedId, isTaggedId, parseTaggedId } from "@endeavorance/tagged-id";

const id = taggedId("demo");
console.log(id); // demo_28hD92jMsIw92KqM

isTaggedId("demo", id); // true
parseTaggedId("demo", id); // demo_28hD92jMsIw92KqM

isTaggedId("other", id); // false
parseTaggedId("other", id) // throws an Error

Set up

Configure your environment to point to git.astral.camp for @endeavorance packages, then install and use as normal.

npm

For NPM, update your .npmrc for the project or globally:

@endeavorance:registry=https://git.astral.camp/api/packages/endeavorance/npm/

Then install with npm i @endeavorance/tagged-id

bun

For Bun, use bunfig.toml

[install.scopes]
endeavorance = "https://git.astral.camp/api/packages/endeavorance/npm/"

Then install with bun add @endeavorance/tagged-id