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

oodle.js

v2.0.3

Published

Simple Oodle data compression wrapper

Readme

Oodle.js

Simple wrapper for Oodle data compression/decompression using native bindings via koffi.

Supports automatic downloading from workingrobot/oodleue or passing a path to the lib manually.

AI was used to generate the README and jsdoc, code is human.


Installation

npm i oodle.js@latest

Compatibility

  • Windows: Tested

  • Linux: Tested

  • macOS: Untested (should work)

  • NodeJS: Tested

  • Bun: Tested

  • Deno: Untested

Please open a PR or an issue if you encounter any errors.


Quick Start

import { Oodle } from "oodle.js";

const oodle = await Oodle.Create();

const input = Buffer.from("Hello, World!".repeat(50));

const compressed = oodle.compress({
	buffer: input,
});

const decompressed = oodle.decompress(
	{
		buffer: compressed,
	},
	input.length
);

console.log(decompressed.toString());

Creating an Instance

const oodle = await Oodle.Create();

Custom library path

const oodle = await Oodle.Create("./native/oodle.dll");

Clear download cache

const oodle = await Oodle.Create(true);

Compression

const compressed = oodle.compress(
	{
		buffer: input,
		size: input.length,   // optional
		offset: 0,            // optional
	},
	OodleCompressor.Kraken,
	OodleCompressionLevel.Optimal
);

Notes

  • Returns a trimmed Buffer
  • Automatically allocates output buffer using Oodle’s size estimator
  • Throws OodleError on invalid ranges or failure

Decompression

const output = oodle.decompress(
	{
		buffer: compressed,
		size: compressed.length,
		offset: 0,
	},
	originalSize
);

Options

{
	fuzzSafe?: OodleFuzzSafe;
	checkCRC?: OodleCheckCRC;
	verbosity?: OodleVerbosity;
	decodeThreadPhase?: OodleDecodeThreadPhase;
}

Use size and offset to select the data you want inside of the Buffer.


Utility Methods

Get compressor type from buffer

const compressor = oodle.getCompressor(buffer);

Maximum compressed size

const max = oodle.maxCompressedSize(1024, OodleCompressor.Kraken);

Minimum decode buffer size

const size = oodle.minDecodeSize(
	buffer.length,
	OodleCompressor.Kraken,
	false
);

Error Handling

try {
	oodle.compress({ buffer: input });
} catch (err) {
	if (err instanceof OodleError) {
		console.log(err.code);
	}
}

OodleError

{
	name: "OodleError",
	message: string,
	code: string,
	isOodleError(): true
}

Internal / Private API Notice

The following properties are NOT part of the public API and should not be used directly unless you know what you're doing:

  • _lib
  • _Compress
  • _Decompress
  • _GetAllChunksCompressor
  • _GetDecodeBufferSize
  • _GetCompressedBufferSizeNeeded

Why?

These are direct native bindings created via koffi and may change without notice. They also lack the abstraction provided by the wrapper.

Always use:

  • compress()
  • decompress()
  • maxCompressedSize()
  • minDecodeSize()
  • getCompressor()

Advanced Notes

  • Compression level affects speed vs ratio
  • Kraken is the default compressor (good balance)
  • Buffer slicing is handled internally (offset, size supported)
  • Native memory allocation is unsafe (Buffer.allocUnsafe) for performance

Type Support

Check typings for:

  • OodleCompressor
  • OodleCompressionLevel
  • OodleFuzzSafe
  • OodleCheckCRC
  • OodleVerbosity
  • OodleDecodeThreadPhase

Example: Full Pipeline

const oodle = await Oodle.Create();

const data = Buffer.from("example data".repeat(100));

const compressed = oodle.compress({ buffer: data });

const decompressed = oodle.decompress(
	{ buffer: compressed },
	data.length
);

console.log(decompressed.equals(data)); // true