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

@codebam/u-serial

v0.2.0

Published

[source code](https://github.com/codebam/serial-mutation-engine)

Readme

@codebam/u-serial

source code

A library for parsing and encoding U-Serials.

Installation

npm install @codebam/u-serial

Usage

Note: As of version 0.0.24, parseSerial, serialToCustomFormat, and customFormatToSerial are now asynchronous and return a Promise. You will need to use await or .then() to get the result.

parseSerial

Parses a Base85 encoded serial string into a serial object.

import { parseSerial } from '@codebam/u-serial';

const serialString =
	'@Ugydj=2}TYg41n&T3U#PNHEPIE8dOQtNYqSJ7*r@!7}Pn`NYqT!NYqT!NYqT!NYqSJE>xm!p;DqoqDrE/pzfglphBT?q1vGmm8e{(Kd3mUbf{aXTc}&8Tc}&8Tc}&8Tc}&8Tc}&8Td1QRXi<w=)S?!(s6{PmQHMIzp$>JZLq#+$E-o%EA}%g2E-o%6A}%g2E-nrp#^w?L';
const serialObject = await parseSerial(serialString);
console.log(serialObject);
// [
// 	{ token: 4, value: 25 },
// 	{ token: 1 },
// 	{ token: 4, value: 0 },
// 	{ token: 1 },
// 	{ token: 4, value: 1 },
// 	{ token: 1 },
// 	{ token: 4, value: 50 },
// 	{ token: 0 },
// 	{ token: 4, value: 2 },
// 	{ token: 1 },
// 	{ token: 4, value: 0 },
// 	{ token: 0 },
// 	{ token: 0 },
// 	{ token: 5, part: { subType: 0, index: 59 } },
// 	{ token: 5, part: { subType: 0, index: 2 } },
// 	{ token: 5, part: { subType: 0, index: 4 } },
// 	{ token: 5, part: { subType: 1, index: 1, value: 12 } },
// 	{ token: 5, part: { subType: 2, index: 8, values: [ { type: 4, value: 14 } ] } },
// 	// removed unneccessary data
// 	{ token: 0 }
// ]

To parse (or encode) many serials you can process them asyncronously. In this example I write them to a JSON file.

This script requires Node.JS and will not work in a browser.

import { parseSerial } from '@codebam/u-serial';
import * as fs from fs; // nodejs
import * as path from 'path'; // nodejs

const serials_path = path.join(__dirname, './serials.txt');
const serials_text = fs.readFileSync(serials_path, 'utf-8');
const serials = serials_text.split('\n').filter((s) => s.length > 0);
const deserialized = Promise.all(serials.map(parseSerial));
const deserialized_path = path.join(__dirname, './deserialized.json');

fs.writeFileSync(deserialized_path, JSON.stringify(await deserialized, null, 2));

encodeSerial

Encodes a serial object into a Base85 encoded serial string.

import { encodeSerial } from '@codebam/u-serial';

const serialObject = [
	{ token: 4, value: 25 },
	{ token: 1 },
	{ token: 4, value: 0 },
	{ token: 1 },
	{ token: 4, value: 1 },
	{ token: 1 },
	{ token: 4, value: 50 },
	{ token: 0 },
	{ token: 4, value: 2 },
	{ token: 1 },
	{ token: 4, value: 0 },
	{ token: 0 },
	{ token: 0 },
	{ token: 5, part: { subType: 0, index: 59 } },
	{ token: 5, part: { subType: 0, index: 2 } },
	{ token: 5, part: { subType: 0, index: 4 } },
	{ token: 5, part: { subType: 1, index: 1, value: 12 } },
	{ token: 5, part: { subType: 2, index: 8, values: [{ type: 4, value: 14 }] } },
	// removed unneccessary data
	{ token: 0 }
];
const serialString = await encodeSerial(serialObject);
console.log(serialString);

serialToCustomFormat

Converts a Base85 encoded serial string to a human-readable custom format.

import { serialToCustomFormat } from '@codebam/u-serial';

const serialString =
	'@Ugydj=2}TYg41n&T3U#PNHEPIE8dOQtNYqSJ7*r@!7}Pn`NYqT!NYqT!NYqT!NYqSJE>xm!p;DqoqDrE/pzfglphBT?q1vGmm8e{(Kd3mUbf{aXTc}&8Tc}&8Tc}&8Tc}&8Tc}&8Td1QRXi<w=)S?!(s6{PmQHMIzp$>JZLq#+$E-o%EA}%g2E-o%6A}%g2E-nrp#^w?L';
const deserialized = await serialToCustomFormat(serialString);
console.log(deserialized); // 25, 0, 1, 50| 2, 0|| {59} {2} {3} {4} {6} {1:12} {20} {66} {65} {73} {16} {32} {16} {51} {65} {73} {65} {73} {65} {73} {65} {73} {44} {4} {43} {68} {65} {66} {16} {27} {31} {32} {44} {54} {4} {4} {44} {31} {24} {52} {43} {43} {43} {43} {43} {43} {43} {43} {43} {43} {43} {43} {3:58} {5} {5} {5} {5} {5} {5} {5} {5} {5} {3} {3} {3} {3} {3} {3} {8:[14 14 14 14 14 2 14 14 14 14 14 14 6 2 14 14 14 14 14 14]}| "c", 71|

customFormatToSerial

Converts a human-readable custom format string to a Base85 encoded serial string.

import { customFormatToSerial } from '@codebam/u-serial';

const deserialized =
	'25, 0, 1, 50| 2, 0|| {59} {2} {3} {4} {6} {1:12} {20} {66} {65} {73} {16} {32} {16} {51} {65} {73} {65} {73} {65} {73} {65} {73} {44} {4} {43} {68} {65} {66} {16} {27} {31} {32} {44} {54} {4} {4} {44} {31} {24} {52} {43} {43} {43} {43} {43} {43} {43} {43} {43} {43} {43} {43} {3:58} {5} {5} {5} {5} {5} {5} {5} {5} {5} {3} {3} {3} {3} {3} {3} {8:[14 14 14 14 14 2 14 14 14 14 14 14 6 2 14 14 14 14 14 14]}| "c", 71|';
const serialString = await customFormatToSerial(deserialized);
console.log(serialString); // @Ugydj=2}TYg41n&T3U#PNHEPIE8dOQtNYqSJ7*r@!7}Pn`NYqT!NYqT!NYqT!NYqSJE>xm!p;DqoqDrE/pzfglphBT?q1vGmm8e{(Kd3mUbf{aXTc}&8Tc}&8Tc}&8Tc}&8Tc}&8Td1QRXi<w=)S?!(s6{PmQHMIzp$>JZLq#+$E-o%EA}%g2E-o%6A}%g2E-nrp#^w?L

CLI Usage

You can use the CLI with npx @codebam/u-serial.

Decode a serial:

npx @codebam/u-serial -d '@Ugydj=2}TYg41n&T3U#PNHEPIE8dOQtNYqSJ7*r@!7}Pn`NYqT!NYqT!NYqT!NYqSJE>xm!p;DqoqDrE/pzfglphBT?q1vGmm8e{(Kd3mUbf{aXTc}&8Tc}&8Tc}&8Tc}&8Tc}&8Td1QRXi<w=)S?!(s6{PmQHMIzp$>JZLq#+$E-o%EA}%g2E-o%6A}%g2E-nrp#^w?L'

Encode a deserialized string:

npx @codebam/u-serial -e '25, 0, 1, 50| 2, 0|| {59} {2} {3} {4} {6} {1:12} {20} {66} {65} {73} {16} {32} {16} {51} {65} {73} {65} {73} {65} {73} {65} {73} {44} {4} {43} {68} {65} {66} {16} {27} {31} {32} {44} {54} {4} {4} {44} {31} {24} {52} {43} {43} {43} {43} {43} {43} {43} {43} {43} {43} {43} {43} {3:58} {5} {5} {5} {5} {5} {5} {5} {5} {5} {3} {3} {3} {3} {3} {3} {8:[14 14 14 14 14 2 14 14 14 14 14 14 6 2 14 14 14 14 14 14]}| "c", 71|'

Piping a serial for decoding:

echo "serial" | npx @codebam/u-serial

Piping a deserialized string for encoding:

echo "deserialized" | npx @codebam/u-serial -e

CDN Usage

You can directly use the library in a standalone HTML page via a CDN like jsdelivr.

<script type="module">
	import {
		serialToCustomFormat,
		customFormatToSerial
	} from 'https://cdn.jsdelivr.net/npm/@codebam/u-serial@latest/dist/api.js';

	async function run() {
		const serialString = 'serial';
		const deserialized = await serialToCustomFormat(serialString);
		console.log(deserialized);

		const customFormat = 'deserialized';
		const encoded = await customFormatToSerial(customFormat);
		console.log(encoded);
	}

	run();
</script>