1---2name: bun-generate-a-uuid3description: Generate a UUID4---56# Generate a UUID78Use `crypto.randomUUID()` to generate a UUID v4. This API works in Bun, Node.js, and browsers. It requires no dependencies.910```ts theme={"theme":{"light":"github-light","dark":"dracula"}}11crypto.randomUUID();12// => "123e4567-e89b-42d3-a456-426614174000"13```1415***1617In Bun, you can also use `Bun.randomUUIDv7()` to generate a [UUID v7](https://www.ietf.org/archive/id/draft-peabody-dispatch-new-uuid-format-01.html).1819```ts theme={"theme":{"light":"github-light","dark":"dracula"}}20Bun.randomUUIDv7();21// => "0196a000-bb12-7000-905e-8039f5d5b206"22```2324***2526See [Docs > API > Utils](/runtime/utils) for more useful utilities.
Run npx skillmds@latest add jarle/bun-generate-a-uuid in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Generate a UUID It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
jarle (@jarle) published this skill. Their other Agent Skills are listed on their SkillMD profile.