{"id":22161354,"url":"https://github.com/appsweet-co/sweetid","last_synced_at":"2026-02-03T02:32:36.083Z","repository":{"id":57675602,"uuid":"444131310","full_name":"Appsweet-co/sweetid","owner":"Appsweet-co","description":"Alphanumeric IDs, powered by Nano ID","archived":false,"fork":false,"pushed_at":"2025-02-28T17:17:43.000Z","size":58,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-24T15:27:10.238Z","etag":null,"topics":["crypto","deno","nanoid","random-generation"],"latest_commit_sha":null,"homepage":"https://deno.land/x/sweetid","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Appsweet-co.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-03T16:41:36.000Z","updated_at":"2022-01-07T04:23:24.000Z","dependencies_parsed_at":"2024-01-03T17:31:30.050Z","dependency_job_id":"4672753b-a30a-43d3-8598-c94648bbf6ff","html_url":"https://github.com/Appsweet-co/sweetid","commit_stats":{"total_commits":20,"total_committers":2,"mean_commits":10.0,"dds":0.25,"last_synced_commit":"a7b80b0da3276710d92f75587172a4da453d9948"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Appsweet-co%2Fsweetid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Appsweet-co%2Fsweetid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Appsweet-co%2Fsweetid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Appsweet-co%2Fsweetid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Appsweet-co","download_url":"https://codeload.github.com/Appsweet-co/sweetid/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248262300,"owners_count":21074283,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crypto","deno","nanoid","random-generation"],"created_at":"2024-12-02T04:14:40.564Z","updated_at":"2026-02-03T02:32:36.058Z","avatar_url":"https://github.com/Appsweet-co.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/readme/logo.png\" alt=\"Logo\" height=\"150\" width=\"auto\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eSweet ID\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003eAlphanumeric IDs, powered by Nano ID\u003c/b\u003e\n\u003c/p\u003e\n\n\u003cbr /\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"GitHub release (latest SemVer)\" src=\"https://img.shields.io/github/v/release/Appsweet-co/sweetid?sort=semver\u0026style=for-the-badge\"\u003e\n\u003c/p\u003e\n\n\u003cbr /\u003e\n\n## Quick Start\n\nImport `mod.ts` directly into your project.\n\n```ts\nimport { sweetid } from \"https://deno.land/x/sweetid/mod.ts\";\n\nsweetid();\n// =\u003e CUXuq1\n```\n\nOr use Sweet ID in the command line.\n\n```zsh\ndeno run https://deno.land/x/sweetid/cli.ts\n# buGdUo\n```\n\n## Details\n\nWe use [Nano ID](https://github.com/ai/nanoid) under the hood to guarantee high-quality, cryptographically secure IDs.\n\nSweet IDs are alphanumeric and always start with a letter.\n\n## ID Length\n\nThe `sweetid()` function generates IDs with a length 6, 12, 24, 48, or 96 characters. IDs are 6 characters long by default.\n\nPass in an optional [`SweetIdSize`](./src/const.ts) as the first argument to set the output size of the ID.\n\n```ts\nsweetid(\"xshort\" || \"xs\");\n// =\u003e MkSofu\n\nsweetid(\"short\" || \"s\");\n// =\u003e bzAuoVKRo1rJ\n\nsweetid(\"medium\" || \"m\");\n// =\u003e XGPCQUqrEVMzMyaU4V52u1LQ\n\nsweetid(\"long\" || \"l\");\n// =\u003e dRjFNY7TrZFqizgKLBwWXAQSErCk51gheMFlBNVAZFM5DuLr\n\nsweetid(\"xlong\" || \"xl\");\n// =\u003e wMoHhg2g2YXqYelDScehIMirOQrEzTPvOI0xqSUXmChqNwHjZQ5kIDTW1f4vjwFIbNt8X6Bzmmz6gEYUQtPuKb9y6u2B4ODE\n```\n\nUse the `--size \u003cSweetIdSize\u003e` (`-s \u003cSweetIdSize\u003e`) flag on the command line to set the output size.\n\n```zsh\ndeno run https://deno.land/x/sweetid/cli.ts -s xs\n# HrcZ9u\n\ndeno run https://deno.land/x/sweetid/cli.ts -s s\n# s75rHr14EJYJ\n\ndeno run https://deno.land/x/sweetid/cli.ts -s m\n# rCJLcqqHW4yuvsSeGPH4INok\n\ndeno run https://deno.land/x/sweetid/cli.ts -s l\n# hMASSfdHZDbpZFHL2UZFWEduk6Ltt5OcxaidVcxXU1K0cyyD\n\ndeno run https://deno.land/x/sweetid/cli.ts -s xl\n# Pzw55DDYGgHE3fGAzGUK7X9MUYizwaGA0vcqVbaYKOce5ij1aRBediwgc1OnRZNjR5u5RKLi7vuonxU1adiAIc2yETrLOyn6\n```\n\n## Generate Multiple IDs\n\nUse the `--count \u003cNUMBER\u003e` (`-c \u003cNUMBER\u003e`) flag on the command line to generate multiple IDs of the same length.\n\n```zsh\ndeno run https://deno.land/x/sweetid/cli.ts -c 3\n# B4a6Xc\n# uRYkkT\n# NJZtjW\n\ndeno run https://deno.land/x/sweetid/cli.ts -s m -c 3\n# hxzRSWPX5TDcQieHk2B7fPkA\n# LXaAyksi6d3HgCAyw2Y4EKM8\n# sZhCDNUjQRJzptbNqGco1HdL\n```\n\n## TypeScript Types\n\nUse [`SweetId`](src/const.ts) and [`SweetIdSize`](src/const.ts) to add type info\nto your project. This is great for things like custom wrapper functions.\n\n```ts\nimport type { SweetId, SweetIdSize } from \"https://deno.land/x/sweetid/mod.ts\";\nimport { sweetid } from \"https://deno.land/x/sweetid/mod.ts\";\n\nexport function customSweetId(size: SweetIdSize = \"long\"): SweetId {\n  return sweetid(size);\n}\n```\n\n_**NOTE: `SweetId` is a\n[flexible nominal type](https://spin.atomicobject.com/2018/01/15/typescript-flexible-nominal-typing/)\nand plays nicely with generic `string` types if needed.**_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappsweet-co%2Fsweetid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappsweet-co%2Fsweetid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappsweet-co%2Fsweetid/lists"}