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

@promistream/hold-markers

v0.1.0

Published

A utility for holding back `EndOfStream`/`Aborted` markers in custom Promistreams from being processed, until all preceding reads have completed. This implements required behaviour for streams that behave specially when encountering end markers; it ensure

Downloads

18

Readme

@promistream/hold-marker

A utility for holding back EndOfStream/Aborted markers in custom Promistreams from being processed, until all preceding reads have completed. This implements required behaviour for streams that behave specially when encountering end markers; it ensures that those markers are the very last thing to be processed, so that eg. your stream doesn't get finalized prematurely while there are still in-flight reads.

Usage

To use this package, you wrap (the Promise returned from) an upstream read call in a holdMarkers call, the function for which you receive after initializing a "marker holder" instance. Like so:

const createMarkerHolder = require("@promistream/hold-markers");

// ...

let holdMarkers = createMarkerHolder();

// ...

// at the point where you're reading:
let result = await holdMarkers(source.read());

It is important that you immediately wrap the read Promise in the holdMarkers call; it must happen in the same tick that you initiated the call, so you cannot do the wrapping at some later (asynchronous) time. Likewise, you must use the wrapped Promise, and not the original one that you passed in, which you should consider to have been 'consumed'. If you get either of these wrong, you will run into unpredictable "unhandled rejection" errors that crash your process.

You will typically need a separate "marker holder" instance per stream instance; if you try to reuse one, you'll get the reads of different streams or stream instances mixed up.

Example

TODO

API

let holdMarkers = createMarkerHolder(contextName)

Creates a new 'marker holder'. You need to create a separate one for every stream instance.

  • contextName: Optional. A name that describes the context in which this library is used; usually the name of the stream. This is used in debug logs.

holdMarkers(promise)

Returns a 'wrapped' version of the Promise that holds back EndOfStream/Aborted markers (if any) until all non-marker reads have completed.

  • promise: Required. The promise to wrap.