UUID String to Buffer Parser

1.1.0 · abandoned · verified Tue Apr 21

uuid-parse is a JavaScript utility for converting RFC4122 UUID strings to Node.js Buffer objects (or Array/Buffer targets) and vice-versa. It provides `parse` and `unparse` functions for this specific transformation. The current stable version is 1.1.0, and the package is explicitly marked as no longer maintained. Its primary differentiator was providing parsing/unparsing functionality that was removed from a prior version of the `node-uuid` library, which is now maintained as `uuid`. Developers should be aware that this module will not receive updates for bugs, security vulnerabilities, or new features, and alternatives like the `uuid` package's `parse` and `stringify` functions are generally recommended for active projects. It does not have a release cadence due to its abandoned status.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates parsing a UUID string into a Buffer and unparsing a Buffer back into a string, including usage with offsets and target buffers.

const uuidParse = require('uuid-parse');

const uuidString = '797ff043-11eb-11e1-80d6-510998755d10';

// Parse a UUID string into a Buffer
const bytes = uuidParse.parse(uuidString);
console.log('Parsed bytes:', bytes.toString('hex'));
// Example with a target buffer and offset
const targetBuffer = Buffer.alloc(32);
const offset = 8;
uuidParse.parse(uuidString, targetBuffer, offset);
console.log('Parsed into target buffer:', targetBuffer.toString('hex'));

// Unparse a Buffer into a UUID string
const string = uuidParse.unparse(bytes);
console.log('Unparsed string:', string);

// Unparsing from a specific offset in a buffer
const unparsedFromOffset = uuidParse.unparse(targetBuffer, offset);
console.log('Unparsed from offset:', unparsedFromOffset);

view raw JSON →