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

@opys/core

v0.1.25

Published

[![npm](https://img.shields.io/npm/v/@opys/core.svg)](https://www.npmjs.com/package/@opys/core)

Readme

@opys/core

npm

The frozen-manifest contract for opys: data model, opys shorthand, Val/Valset, glob, interpolation. Behaviors are backed by the opys-core Rust crate via napi-rs; domain types and small sugar helpers are hand-written TS.

npm install @opys/core

Domain types

Source — artifact origin

type Source =
  | { kind: 'url'; url: string }
  | { kind: 'file'; file: string }
  | { kind: 'string'; string: string }
  | { kind: 'bytes'; bytes: string } // base64
  | { kind: 'pointer'; pointer: string };

sourceUrl('https://example.com/file.jar');
sourceFile('./local/file.jar');
sourceString('inline content');
Source.bytes(new Uint8Array([1, 2, 3])); // auto-base64
sourcePointer('forge:libraries.json');

ExtractRule — zip extraction instructions

type ExtractRule =
  | { kind: 'pick'; file: string; into: string } // single file
  | { kind: 'scan'; matches: string; into: string; ... } // glob match
  | { kind: 'dump'; into: string; clean?: boolean; ... }; // full extract

extractPick('lwjgl.dll', '${natives_directory}');
extractScan('*.so', '${natives_directory}', { excludes: ['META-INF/'] });
extractDump('${natives_directory}', { clean: true, excludes: ['META-INF/'] });

Artifact — a single installable artifact

An artifact has a source, optional integrity/size checks, optional extract rules, and optional rulesets that gate it per platform or feature.

Manifest — the frozen wire shape

import { parseManifest, filterManifest, encodeManifest } from '@opys/core';

const manifest = parseManifest(jsonString);
const filtered = filterManifest(manifest, {
  name: 'linux',
  version: '',
  arch: 'x86_64',
});
const wire = encodeManifest(filtered);

ValDefs — interpolation variables with OS-conditional arms

import { resolveValDefs, resolveVars, interpolate } from '@opys/core';

const flat = resolveValDefs(defs, platform); // pick OS-appropriate values
const vars = resolveVars(flat); // resolve ${ref} chains
const result = interpolate('${root}/assets', vars);

Build-time HTTP helper

import { fetchWithRetry } from '@opys/core';

const res = await fetchWithRetry('https://api.example.com/data', {
  attempts: 4,
  baseDelayMs: 250,
});

Used by every plugin that resolves data from upstream APIs. Bounded exponential backoff on transient errors (network failures + 5xx); 4xx and JSON-parse failures surface unchanged.

Frozen wire format

opys.json is the contract. Other opys packages layer on top:

  • @opys/dev — config + plugin SDK that produces manifests.
  • @opys/runtime — install + launch executor that consumes manifests.

Part of the opys toolkit.