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/java

v1.0.13

Published

OpenJDK runtime support for torba — auto-installs an [Eclipse Temurin](https://adoptium.net) JDK and exposes `${java_home}` and `${java_bin}` as standardized vars so loader templates can reference a portable Java binary.

Readme

@torba/java

OpenJDK runtime support for torba — auto-installs an Eclipse Temurin JDK and exposes ${java_home} and ${java_bin} as standardized vars so loader templates can reference a portable Java binary.

Install

npm install @torba/java

Usage

import { resolveJava } from '@torba/java';
import { resolveLwjgl3ify } from '@torba/lwjgl3ify';

const lw = await resolveLwjgl3ify({ version: '3.0.16' });
const jav = await resolveJava({ version: '21' });

return {
  manifest: {
    artifacts: [lw.artifacts, jav.artifacts],
    vars: { ...lw.vars, ...jav.vars },
    launch: lw.launch, // launch.command is `${java_bin}` already
  },
};

Version input

  • Major'21', '17' — resolves to the latest GA release for that major.
  • Full version'21.0.11+10' — exact Adoptium release name (jdk- prefix and -LTS suffix are tolerated).

Options

resolveJava({
  version: string,
  vendor?: 'openjdk',         // only OpenJDK (Temurin) is supported today
  platforms?: JavaPlatform[], // override the default OS/arch matrix
  apiBase?: string,           // override the Adoptium API base URL
});

How it works

  1. Resolves the requested version against https://api.adoptium.net/v3/. Major versions hit /feature_releases/<n>/ga (latest GA); full versions hit /release_name/eclipse/jdk-<v> (exact).
  2. Queries each platform (linux/osx/windows × x86_64+aarch64) in parallel; soft-skips combinations that don't ship a binary.
  3. Emits one Artifact per platform pointing at the GitHub-hosted release asset, with sha256 from the API and OS+arch rules so only the matching binary downloads at install time.
  4. Each artifact has an extract: dump rule pointing at ${root}/runtimes/jdk-<major>/, so the JDK lands at ${root}/runtimes/jdk-<major>/jdk-<full>/.
  5. Sets java_home (per OS — macOS gets the /Contents/Home suffix) and java_bin (${java_home}/bin/java on POSIX, ${java_home}/bin/java.exe on Windows).

@torba/installer extracts both .zip (Windows) and .tar.gz / .tgz (Linux/macOS) archives, preserving the executable bit on tar entries so bin/java stays runnable without a chmod step.

Standard ${java_home} and ${java_bin} vars

Every torba template returned by @torba/minecraft (and by any loader built on it) now sets launch.command = '${java_bin}', with java_bin defaulting to the literal 'java' (PATH lookup). When you spread @torba/java's vars over the loader's, the var resolves to the auto-installed JDK instead — without any change to the launch command.

Notes

  • Vendor: only openjdk (Eclipse Temurin) is supported. Adding Liberica, Zulu, GraalVM is a matter of plugging in another resolver.
  • macOS app bundles: macOS Temurin tarballs ship as .app bundles with Contents/MacOS/_CodeSignature/.... ${java_home} includes the /Contents/Home suffix automatically.
  • Disk usage: each JDK is ~200 MB compressed, ~500 MB extracted. The archive is downloaded into ${root}/runtimes/ as a sibling of the jdk-<major>/ extract target — delete the leftover .tar.gz/.zip archive there to reclaim space.