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

@torba/installer

v1.0.5

Published

Programmatic install and launch for Torba manifests. Downloads artifacts in parallel, verifies integrity, extracts natives, and spawns the JVM.

Readme

@torba/installer

Programmatic install and launch for Torba manifests. Downloads artifacts in parallel, verifies integrity, extracts natives, and spawns the JVM.

Install

npm install @torba/installer @torba/core

Manifest sources

Both install and launch accept a manifest source as their first argument:

| Value | Example | | ----------------- | ------------------------------------------ | | File path string | 'torba.json' | | HTTPS URL object | new URL('https://example.com/pack.json') | | Parsed Manifest | object returned by resolveManifest |


install(source, options?)

Streams missing artifacts to <finalPath>.partial then renames them into place; extracts zips for artifacts with extract rules. Already-cached artifacts (path exists on disk) are skipped. A failed integrity check throws IntegrityError immediately.

import { install } from '@torba/installer';

await install('torba.json', {
  vars: {
    root: '/opt/minecraft/1.20.1',
    username: 'Player',
    uuid: '...',
    token: '...',
  },
  concurrency: 16,
  onProgress(p) {
    if (p.phase === 'download') {
      process.stderr.write(`  ${p.fetched}/${p.total}\r`);
    }
  },
});

Options

| Option | Type | Default | Description | | ----------------- | ------------------------------ | ------- | ---------------------------------- | | platform | OsOptions | auto | Override OS/arch detection | | vars | Record<string, string> | {} | Extra vars; override manifest vars | | concurrency | number | 8 | Max parallel downloads | | onProgress | (p: InstallProgress) => void | — | Progress callback | | verifyIntegrity | boolean | true | Skip hash checks if false |

InstallProgress

type InstallProgress =
  | { phase: 'resolve' }
  | { phase: 'download'; fetched: number; total: number; skipped: number }
  | { phase: 'verify' }
  | { phase: 'extract'; count: number };

launch(source, options?)

Runs install then spawns the process described by the manifest's launch config. Returns a ChildProcess — the caller decides how to wait on it.

Pass install: false to skip installation.

import { launch } from '@torba/installer';

const child = await launch('torba.json', {
  vars: {
    root: '/opt/minecraft/1.20.1',
    username: 'Player',
    uuid: '...',
    token: '...',
  },
  install: { onProgress: (p) => console.log(p) },
});

await new Promise<void>((resolve, reject) => {
  child.on('exit', (code) =>
    code === 0 || code === null ? resolve() : reject(new Error(`exit ${code}`)),
  );
  child.on('error', reject);
});

Options

| Option | Type | Default | Description | | ---------- | ------------------------- | ------- | -------------------------------------- | | platform | OsOptions | auto | Override OS/arch detection | | vars | Record<string, string> | {} | Extra vars; typically auth credentials | | install | InstallOptions \| false | {} | Install options, or false to skip | | log | (level, msg) => void | — | Debug/warn logger for spawn details |


resolveManifest(source)

Resolves any manifest source to a Manifest object.

import { resolveManifest } from '@torba/installer';

const manifest = await resolveManifest('torba.json');
console.log(manifest.artifacts.length);

currentPlatform()

Returns the OsOptions for the current host.

import { currentPlatform } from '@torba/installer';

const platform = currentPlatform();
// { name: 'linux', arch: 'x64', version: '...' }

Error types

| Class | When | | ----------------- | ---------------------------------- | | NetworkError | HTTP download failure | | IntegrityError | Hash mismatch on a downloaded file | | ExtractionError | ZIP extraction failure |