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

small-frame

v0.1.1

Published

Zero-dependency structured message frame for small binary messages.

Downloads

13

Readme

small-frame

Zero-dependency structured message frame for small binary messages using the Really Compact Structured Binary (RCSB) encoding format.

[!WARNING] This project is still in development and the API is not stable.

Usage

import { createFrameFromFields, FieldType, SerializerDataType } from "small-frame";

const UserFrame = createFrameFromFields({
  name: FieldType.String,
  age: FieldType.Number,
  isAdmin: FieldType.Boolean,
});

export type User = typeof UserFrame.$type;

const user = { 
  name: "Kane", 
  age: 20, 
  isAdmin: false 
};

// Serialize to RCSB format
const buffer = UserFrame.serialize(user);

// Deserialize from RCSB format
const user2 = UserFrame.deserialize(buffer);

console.log(user2);

The value will be serialized as:

04 4b 61 6e 65 00 00 00 14 00
└─ "Kane" (5)  └─ 20 (4)   └─ false (1)

Total size: 10 bytes

Really Compact Structured Binary (RCSB) Specification

RCSB is a compact, type-safe binary serialization format designed for really small structured messages. It provides predictable encoding with minimal overhead and strong type safety.

Data Types

| Type | Size | Description | |------|------|-------------| | Boolean | 1 byte | 0x00 for false, 0x01 for true | | Number | 4 bytes | 32-bit unsigned integer (uint32) | | BigInt | 8 bytes | 64-bit unsigned integer (uint64) | | String | 1 + N bytes | Length prefix (uint8) + UTF-8 encoded bytes |

String Encoding

Strings are encoded as:

[length: uint8][utf8_bytes...]
  • Maximum string length: 255 bytes (uint8 max)
  • UTF-8 encoding is used for text

Structure Encoding

Message structures are encoded by concatenating fields in definition order:

field1_bytes + field2_bytes + field3_bytes + ...

No delimiters or padding between fields. The total size is the sum of all field sizes.

Size Calculation

The serialized size can be calculated as:

  • Boolean: 1 byte
  • Number: 4 bytes
  • BigInt: 8 bytes
  • String: 1 + UTF-8 byte length