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

@velarscript-labs/compression

v0.1.5

Published

Bounded DEFLATE and gzip adapter for VelarScript.

Readme

@velarscript-labs/compression

An independently versioned, bounded DEFLATE and gzip adapter backed by fflate. Decompression requires or applies a hard output limit and never allocates an unbounded result.

import {gzip, gunzip} from "@velarscript-labs/compression"

const archived = gzip(payload)
const payload = gunzip(archived, 8 * 1024 * 1024)

Decompression bounds

inflate and gunzip feed the compressed input in fixed-size chunks. The chunk is sized once from maxBytesceil(maxBytes / 1032) clamped to 256 bytes through 64 KiB — and never from the output produced so far, so a tight budget cannot degrade the feed to one byte per push. maxBytes itself is enforced in the decoder's output callback, so the decoder can buffer maxBytes plus one input chunk expanded at the DEFLATE maximum ratio — one chunk times 1032, which is about maxBytes again and never less than 258 KiB — before the limit aborts the stream.

A stream that consumes input without producing output is rejected. Past the first 1 MiB of input, decompression requires at least one output byte for every 64 input bytes and otherwise fails with an assertion error, so a hostile zero-yield stream stops after roughly 1 MiB instead of being read to the end. A gzip member's header counts as consumed input, so a member carrying more than 1 MiB of header metadata — an FNAME or FCOMMENT field far larger than any real archive writes — is rejected by that bound instead of decoded.

HTTP response compression remains an internal concern of the Node server; this package is the explicit standalone codec API.