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 🙏

© 2025 – Pkg Stats / Ryan Hefner

serdebin

v1.2.3

Published

Bit-level serialization written in typescript

Downloads

3

Readme

jserde - Bit-level serialization written in typescript

Use

Should take a look at test.ts!

Another JWT replacement?

Known limitations

Currently:

  • You can't store negative, floats, just unsigned int

Now with helper module (deserialization below)

import { u, vstr, build } from "serdebin/helper";
const uint8array = build(
  u(8, 255),
  false,
  true,
  vstr("Hello World!"),
  vstr("Hello World!", 8),
);

Detailed use (old)

  • Serialization
import {
  Deserialization,
  build,
  decu8,
  extract_scalar,
  extract_str,
  makeFixed,
  toui8a,
} from "serdebin";

// example data lol
const data = [
  false, // Boolean can be passed directly
  ...makeFixed(extract_scalar(32), 6),
  ...extract_str("Hello World!"), // Remember your string length?
  ...makeFixed(extract_str("no bye"), 16/* Max string length*/ * 8)
  ...makeFixed(extract_scalar(255), 8),
  ...makeFixed(extract_scalar(Date.now()), 42),
];

const uint8array = build(data), // build into utf-8 data
  decodedui8 = decu8(uint8array)
  • Deserialization
const reader = new Deserialization(se);
const funny = reader.b(),
  // read unsigned
  min = reader.u(6),
  // read string
  msg = reader.s(12),
  msgf = reader.s(16),
  max = reader.u(8),
  date = reader.u(42);

Strategies (old)

  • Variable length string
const words = "You know the rules, and so do I";
[
  ...makeFixed(extract_scalar(words.length), 24), // parse into 24bit string
  ...extract_str(words), // and read it
];
const reader = new Deserialization(ui8a);
const str = reader.s(reader.u(24));

...and more, if you smart enough

Benchmark???

I found this interesting.

bun's result:
[1.39ms] str
[0.18ms] ser
[0.05ms] de
node's result:
str: 0.452ms
ser: 0.179ms
de: 0.007ms
and browser's
str: 0.3330078125 ms
ser: 0.0732421875 ms
de: 0.004150390625 ms

so it must be extract_*'s fault, maybe?

haha, enjoy!

This project was created using bun init in bun v0.6.14. Bun is a fast all-in-one JavaScript runtime.