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

@endo/syrup-frame

v0.1.1

Published

Implements a JavaScript async iterator protocol for consuming and producing Syrup byte-string-framed streams: a sibling of @endo/netstring with no trailing comma.

Downloads

125

Readme

@endo/syrup-frame

@endo/syrup-frame implements an async-iterator protocol for framing binary messages as a length-prefix followed by a payload, with no trailing separator.

It is a sibling of @endo/netstring whose only difference is the absence of the trailing , separator. The grammar is:

frame   = length ":" payload
length  = 1*DIGIT
payload = length * OCTET

A framed message on the wire is therefore literally a Syrup byte-string record: identical to Syrup's <length>:<bytes> grammar. This is the whole motivation for the package. OCapN transports that carry Syrup-encoded messages can share a single length-prefixed primitive with the payload format itself, eliminating a redundant delimiter byte per message and giving "a frame" and "a Syrup byte string" the same on-the-wire encoding.

Why not @endo/netstring?

DJB's netstring specification is explicit that a netstring carries a trailing ,. A netstring without the separator is not a netstring; conflating the two by adding an option to @endo/netstring would blur the identity of that package. @endo/syrup-frame is a deliberate departure, named for its purpose.

Scope

This package exists to test interoperability with the OCapN TCP-for-testing protocol, which has moved to adopt this framing. That framing is among the protocols under consideration in the OCapN pre-standards group at time of writing. The existing @endo/netstring package remains the canonical netstring implementation and continues to serve the Endo daemon's tcp+netstring+json+captp0 transport and any other caller that wants strict netstring compliance.

API

import {
  makeSyrupReader,
  makeSyrupWriter,
} from '@endo/syrup-frame';

makeSyrupReader(input, opts?) -> Reader<Uint8Array, undefined>

Wraps an iterable/async-iterable of byte chunks into an async iterator of whole frames. Handles arbitrary chunk boundaries (length prefix split across chunks, payload split across chunks).

Options:

  • name: identifier embedded in error messages.
  • maxMessageLength: upper bound on any single payload, default 999_999_999 (same as @endo/netstring).

makeSyrupWriter(output, opts?) -> Writer<Uint8Array | Uint8Array[]>

Wraps an output byte writer into a frame writer.

Options:

  • chunked: when true, emit the prefix and each payload chunk as separate writes. Required for zero-copy writers. Identical to @endo/netstring's chunked option minus the separator write.

Design

See designs/ocapn-tcp-syrup-framing.md in the repository root.