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

@marceloclp/bsd

v0.1.5

Published

Type-safe, composable binary decoding for TypeScript.

Readme

BSD

Docs

BSD (Binary Schema Decoder) is a type-safe, composable binary decoder for TypeScript. Schemas consume a Uint8Array sequentially and return statically inferred values.

BSD supports little-endian numbers, byte ranges, strings, arrays, structs, unions, validation, transformations, and dynamic schema composition. It decodes binary data; it does not encode it.

Quick start

Install the package:

bun add @marceloclp/bsd

Alternatively:

npm install @marceloclp/bsd

Define a schema and decode a Uint8Array:

import { bytes, struct, u8, u16, type BsdInfer } from "@marceloclp/bsd";

const Profile = struct({
    version: u8().is(1),
    id: u16(),
    name: bytes(u8()).utf8(),
});

type Profile = BsdInfer<typeof Profile>;

const input = Uint8Array.of(
    1, // version
    42,
    0, // id: 42
    3, // name length
    65,
    100,
    97, // "Ada"
);

const profile: Profile = Profile.decode(input, { strict: true });
// { version: 1, id: 42, name: "Ada" }

Schemas consume fields in declaration order. { strict: true } rejects trailing bytes after the schema finishes.

Contributing

Contributions are welcome. To work on BSD:

  1. Fork the repository and clone your fork.
  2. Install Bun and run bun install.
  3. Create a branch for your change.
  4. Add or update tests.
  5. Run the verification commands:
bun test
bun run typecheck
bun run lint
bun run build

For documentation changes, also run:

bun run docs:validate
bun run docs:build

Open a pull request describing the problem, the implementation, and any behavioral or API changes. Keep changes focused and include failing regression tests when fixing bugs.