npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cbortech/uuid-extension

v0.3.1

Published

UUID application-string extension for @cbortech/cbor

Readme

@cbortech/uuid-extension

UUID application-string extension for @cbortech/cbor.

@cbortech/cbor is a TypeScript library for converting between CBOR, CDN, and JavaScript values.

The playground is published at https://cbor.tech/cbor/.

This extension uses the CBOR UUID tag number 37.

Installation

npm install @cbortech/cbor @cbortech/uuid-extension

Usage

uuid extension

import { CBOR } from '@cbortech/cbor';
import { uuid } from '@cbortech/uuid-extension';

const cbor = new CBOR({ extensions: [uuid] });

// Parse CDN containing UUID values.
const document = cbor.parse(`{
  "id": uuid'019e226f-78d8-7892-8c91-79013e6905e2',
  "taggedId": UUID'019e312c-ec71-76f6-a959-fa3acc220b55'
}`);
// document.id is a bare Uint8Array.
// document.taggedId is tag 37 over a Uint8Array.

// Convert CDN containing a UUID value into CBOR.
const tagged = cbor
  .fromCDN("UUID'019e226f-78d8-7892-8c91-79013e6905e2'")
  .toCBOR();
// tagged is CBOR binary data stored as a Uint8Array.
// Inspect the encoded CBOR value with toHexDump():
console.log(CBOR.fromCBOR(tagged).toHexDump());
// D8 25                                                  -- Tag 37
//    50 01 9E 22 6F 78 D8 78 92 8C 91 79 01 3E 69 05 E2  -- h'019e226f78d878928c9179013e6905e2'

// Format CDN with tag 37 as UUID'...'.
console.log(cbor.format("37(h'019e226f78d878928c9179013e6905e2')"));
// UUID'019e226f-78d8-7892-8c91-79013e6905e2'

uuid_as_UUID extension

The uuid_as_UUID extension converts UUID'...' and 37(h'...') to UUID objects from @cbortech/uuid.

import { CBOR } from '@cbortech/cbor';
import { uuid_as_UUID } from '@cbortech/uuid-extension';
import { UUID } from '@cbortech/uuid';

const cbor = new CBOR({ extensions: [uuid_as_UUID] });

// UUID'...' values become UUID objects via toJS().
const item = cbor.fromCDN("UUID'019e226f-78d8-7892-8c91-79013e6905e2'");
const value = item.toJS();
console.log(value instanceof UUID); // true
if (value instanceof UUID) console.log(value.parse());
// { ver: 7, unix_ts_ms: 1778694191320, rand_a: 2194, var: 'RFC4122', rand_b: ...n }

// toCDN() still emits UUID'...' notation.
console.log(item.toCDN()); // UUID'019e226f-78d8-7892-8c91-79013e6905e2'

// 37(h'...') notation is also converted to a UUID object.
const item2 = cbor.fromCDN("37(h'019e226f78d878928c9179013e6905e2')");
console.log(item2.toCDN()); // UUID'019e226f-78d8-7892-8c91-79013e6905e2'

// UUID objects are encoded as tag 37 over a 16-byte string.
const encoded = cbor
  .fromJS(new UUID('019e226f-78d8-7892-8c91-79013e6905e2'))
  .toCBOR();
console.log(cbor.fromCBOR(encoded).toCDN()); // UUID'019e226f-78d8-7892-8c91-79013e6905e2'

// Untagged uuid'...' values still produce Uint8Array via toJS().
const bare = cbor.fromCDN("uuid'019e226f-78d8-7892-8c91-79013e6905e2'");
console.log(bare.toJS()); // Uint8Array

CDN Forms

  • uuid'019e226f-78d8-7892-8c91-79013e6905e2' produces a bare 16-byte string.
  • UUID'019e226f-78d8-7892-8c91-79013e6905e2' produces tag 37 over the 16-byte string.
  • Raw string forms such as uuid`019e226f-78d8-7892-8c91-79013e6905e2` are also supported.
  • App-sequence forms such as uuid<<"019e226f-78d8-7892-8c91-79013e6905e2">> are also supported.

UUID text is validated as the canonical 8-4-4-4-12 hexadecimal form. Uppercase hexadecimal input is accepted and serialized back as lowercase canonical text.

License

Apache-2.0