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

engram-nodejs

v0.1.3

Published

High-level Node.js toolkit for reading and writing Engram (.eng) archives with prebuilt native binaries.

Readme

Engram for Node.js

Engram ships a native Node.js addon plus a tidy TypeScript wrapper that lets you open .eng archives, stream files, and query the bundled SQLite databases without leaving JavaScript.

You get prebuilt binaries for the common desktop/server platforms, type definitions for TypeScript, and a small ergonomic API for both reading and authoring Engram archives.

What you can do

  • Mount an .eng archive and list, read, or batch fetch files.
  • Inspect archive metadata, manifest contents, and media assets.
  • Open the embedded SQLite database with zero-copy access.
  • Create or update archives by writing files, JSON, and databases.
  • Run the same code in Node.js, Electron, or serverless environments with Node 18+.

Installation

Engram is published as a standard npm package with prebuilt native binaries.

# npm
npm install engram-nodejs

# or pnpm
pnpm add engram-nodejs

# or yarn
yarn add engram-nodejs

Requirements:

  • Node.js 18 or newer (native fetch, worker threads, and napi ABI 8 support)
  • macOS (x64/arm64), Windows (x64), or Linux (x64 glibc). More targets are coming; open an issue if you need something different.

No Rust toolchain or build dependencies are needed unless you choose to compile from source.

Quick start

import { EngramArchive } from 'engram-nodejs';

const archive = new EngramArchive('path/to/my.archive.eng');

console.log(`Entries: ${archive.entryCount}`);
console.log(archive.listFiles().slice(0, 5));

const manifest = await archive.readJson('manifest.json');
console.log(`Project: ${manifest.name} v${manifest.version}`);

const db = archive.openDatabase('data/catalog.sqlite');
const topStories = db.query<{ id: string; title: string }>(
  'select id, title from posts order by published_at desc limit 10'
);
console.log(topStories);

API highlights

  • EngramArchive – open an archive, list files, read binary/text/JSON content, access the manifest, or open SQLite databases.
  • EngramDatabase – run synchronous SQL queries (query, queryOne, queryValue, execute) against the embedded SQLite database.
  • EngramWriter – create a new archive, add files from buffers/disk, set compression, attach manifests, and finish with finalize().
  • CompressionMethod – enumerate the compression algorithms supported when writing archives.

Check lib/index.d.ts or run your editor’s “Go to Definition” for the full typed surface area.

Common recipes

Read a text asset

const doc = await archive.readText('docs/intro.md');

Stream multiple files at once

const [logo, hero] = await archive.readFiles([
  'assets/logo.svg',
  'assets/hero.png',
]);

Build a new archive

import { EngramWriter, CompressionMethod } from 'engram-nodejs';

const writer = new EngramWriter('dist/my.export.eng');
writer.addManifest({ name: 'Sample', version: '1.0.0' });
writer.addJson('data/stats.json', { total: 42 });
writer.addFileWithCompression(
  'assets/hero.png',
  await fs.promises.readFile('public/hero.png'),
  CompressionMethod.Brotli,
);
writer.finalize();

Working with TypeScript and bundlers

  • Type definitions are bundled, so no extra @types package is needed.
  • The package exports CommonJS (require) by default; if you are using ESM, rely on Node’s createRequire or enable transpiler interop (for example esModuleInterop in TypeScript).
  • When shipping Electron apps, ensure the native binary ends up alongside your compiled JavaScript. Tools like electron-builder handle this automatically when you declare a dependency.

Troubleshooting

  • “Cannot find module” – ensure the install step completed; delete node_modules and reinstall if you upgraded Node versions.
  • Native module load errors – verify you are on Node 18+ and one of the listed platforms. For other environments (e.g., Alpine) file an issue so we can provide a tailored build.
  • Archive path issues – paths are resolved relative to the current working directory; pass absolute paths when embedding inside packaged apps.
  • Workflow schema validation – if CI complains about the benchmark workflow shape, convert it to JSON and validate against GitHub’s schema:
    curl -sSL https://www.schemastore.org/github-workflow.json -o /tmp/github-workflow.schema.json
    npx js-yaml .github/workflows/benchmark-version-bump.yml > /tmp/benchmark-version-bump.json
    npx ajv-cli validate -s /tmp/github-workflow.schema.json -d /tmp/benchmark-version-bump.json

If you run into anything else, open an issue or start a discussion. We love seeing how you use Engram and are happy to help unblock you.

License

MIT – see LICENSE for the full text.