🌳 JavaScript · deploying · sharing tools

Ship the Tree

A story about shipping JavaScript.

Philipp Dunkel · @pipobscure.com

github.com/pipobscure/bundles

I · On the server

The registry is down

# deploying, 16:40 on a Tuesday
$ git pull && npm install --production
npm ERR! fetch failed registry.npmjs.org/…
npm ERR! 503 Service Unavailable

# the code hadn’t changed.
# the build had.

Someone else’s uptime

The registry sits in the path of every deploy, and you don’t run it.

npm’s own status page

Jul 2026

Publish and install failures

Dec 2025

Can’t reach the registry

Jun 2025

Install, publish and login failing

Dec 2024

Installs fail in one region

20 install or registry incidents since Oct 2023, 9 of them major.

I · On the server

A semver isn’t an install

$ npm install
added 214 packages in 9s

# which 214?
# from where?
# and what just ran?

A dice roll when it’s up

^1.2.0 means “whatever the registry says today”.

Decided at install time

Not when you released, and not when you tested.

Installing runs code

postinstall scripts run before anyone has looked at anything.

Nothing writes it down

Two installs of one version can differ, and nobody can say how.

I · On the server

Version ≠ code

2018

event-stream

A helpful new maintainer, then a wallet stealer in a dependency.

2021

ua-parser-js

An account taken over. Millions of weekly installs shipped a miner.

2024

xz-utils

Years of patient social engineering, for one backdoor.

2025

Shai-Hulud

A worm: it steals CI tokens and publishes itself onward.

Each was published correctly. You asked for a version, you got that version, and you still got owned.

I · On the server

We patched around it

Lockfiles

Pin which versions. The network and the install scripts are still in the deploy.

Container images

Same bytes everywhere. You ship an operating system, and npm ci still ran inside it.

Bundlers

One JS file, until templates, native addons or a dynamic require fall out of it.

Compiled binaries

One file, but you can’t look inside, and it is rarely signed over the whole thing.

All of them work. None tells you, months later, exactly what runs and who put it there.

II · Sharing tools

Now share a tool

how it usually goes

$ git clone … && cd tool
$ nvm use 20  # works on 18?
$ npm ci     # hundreds of MB
$ npm link   # on PATH. somewhere.

how it should go

$ curl -O …/tool
$ ./tool

# that’s it

A CLI is one file, or it’s a support ticket.

II · Sharing tools

10 Machines, 10 versions

“Works for me.”

Which version does your colleague have? Does CI run the one you run?

Updates by Slack message

“Please pull and re-link.” Half the team does.

A toolset, not a tool

Five CLIs that only work together at matching versions.

Someone else’s tool

npm i -g from a stranger runs their install scripts as you.

II · Sharing tools

My wishlist

One file, decided when we release

Runs by name, no install step

Says who built it, and can’t change afterwards

Others can vouch for it, or warn us off

The same thing in CI, on laptops and on servers

III · What had to exist first

Apps are trees

// survives a bundler
import helper from './helper.js'

// does not
readFileSync(join(__dirname, 'mail.html'))
require(`./plugins/${name}`)
process.dlopen(m, './addon.node')

Module resolution and every fs call assume the tree is on a real disk.

So teach the runtime that a file can be a directory.

III · What had to exist first

Archives, built in

v26.8

ZIP in node:zlib

Read, write and stream ZIP archives, built into Node.

why

A format every tool already opens. It still reads with a launcher in front of it, and malformed or oversized archives are refused.

import { ZipEntry, createZipArchiveSync } from 'node:zlib';
const zip = createZipArchiveSync([
  ZipEntry.createSync('package.json',
    Buffer.from('{"main":"index.js"}')),
  ZipEntry.createSync('index.js',
    Buffer.from('console.log("hi")')),
]);
writeFileSync('app.zip', Buffer.concat([...zip]));

$ unzip -Z1 app.zip
package.json
index.js

III · What had to exist first

Files from anywhere

v26.4 · by Matteo Collina

node:vfs

An fs-shaped file system whose files come from a pluggable provider, mounted at a path.

why

Every fs call under the mount goes to the provider, so code that reads files keeps working, unchanged. A ZipProvider (v26.9) mounts an archive.

import * as vfs from 'node:vfs';

const mem = new vfs.MemoryProvider();
mem.writeFileSync('/hello.txt', 'hi from memory');
const root = vfs.create(mem).mount(); // /dev/null/vfs/1

readFileSync(`${root}/hello.txt`, 'utf8');
// 'hi from memory'

III · What had to exist first

Importing from a zip

v26.10 · addons v26.9

Loading from a mount

require, import, package.json lookup and format sniffing all resolve inside the mount.

why

__dirname, assets and dynamic requires just work. Worker threads see the same mount, and native addons load from it too.

import * as vfs from 'node:vfs';
import { ZipFile } from 'node:zlib';

const zip = await ZipFile.open('app.zip');
const root = vfs.create(new vfs.ZipProvider(zip)).mount();

await import(`${root}/index.js`);
// hi

III · What had to exist first

One flag at startup

v26.10

--vfs-load

Mounts a directory or an archive where Node chooses, and runs its package.json main.

why

One flag, so a two-line #! launcher makes a zip a program. Refused in NODE_OPTIONS: the environment can’t redirect what runs.

$ node --experimental-vfs --vfs-load=app.zip
hi

$ NODE_OPTIONS="--vfs-load=app.zip" node
node: --vfs-load= is not allowed in NODE_OPTIONS

III · What had to exist first

All shipped in Node

v26.4

node:vfs

A file system with pluggable providers. By Matteo Collina.

v26.8

ZIP in node:zlib

Read and write archives, reviewed with security researchers.

v26.9

ZipProvider

Mount an archive as a directory. Native addons load from it.

v26.10

--vfs-load

Run a program straight out of the archive.

Stock Node from nodejs.org, behind --experimental-vfs. No fork, no patches.

Before 26.10, running this meant a patched Node, built from source on every server: 30 to 90 minutes. Now it’s the download.

III · What had to exist first

Userland: bundle

🌳 bundle

npm: @pipobscure/bundle · a CLI and an API

record

Run the app once, and write down every file it reads.

create

Archive exactly those, with a launcher in front.

sign · attest

Say who built it, and let others say what they found.

install · update

Onto your PATH, and kept current.

publish · search

Names in your own Atmosphere account.

suites · plugins

Toolsets, and apps that take plugins.

Node mounts the tree and runs it.

node:vfs · zip · --vfs-load

III · What had to exist first

Keyless signing

1 · observe

Run the app once and write down every file it reads.

2 · create

Archive exactly those files. Same files, same bytes.

3 · audit

Review it against the last release: you, or Claude in CI.

4 · sign

Only if the review came back clean.

# release.yml
permissions:
  id-token: write # that’s the key

Sigstore signs as your CI workflow, or as your browser sign-in on a laptop.

Users can require exactly that workflow, on main.

III · What had to exist first

No new registry

publisher

Listing

“mdview is at this URL.” Releases stay where they are.

curator

Suite

“These go together, and each must carry this.”

auditor · scanner · IT

Attestation

“Audited”, “permitted”, “malware”, about one file’s hash.

Each one is a record in their own Atmosphere account, any provider.

Checked against the owner’s key with nothing but node:crypto.

You hold the policy: whose word counts, and whose warning stops an install.

An open index only says whom to ask.

IV · What you can do now

Your app, one file

$ bundle create --base ./app -f app.manifest --launcher -o greet.unsigned.nzip
* unsigned archive (3 members, sha256 digests)
$ bundle sign greet.unsigned.nzip
* wrote greet.nzip (1904 bytes)
$ ./greet.nzip Grace
hello, Grace
$ head -2 greet.nzip
#!/bin/sh
exec node --no-warnings --experimental-vfs --vfs-load="$0" -- "$@"

Two kilobytes

Only the files the app read.

It’s a zip

unzip -l shows everything in it.

Plain node runs it

No node_modules, no install step.

IV · What you can do now

See who vouches

$ bundle install @alice.example/tool
* tool: sha256:3f1a… (signed)
   1 signed by   …/acme/tool/.github/workflows/release.yml@refs/heads/main — new
   2 attested by audit.acme.com as audited — trusted by policy
     WARNING     scanner.example as malware — marked it bad
* accept which? numbers (1,2), 'all', or Enter to decline:

Nothing runs to install

Fetch, check, move into place. No install scripts.

You decide once

Your answer is remembered for every update.

Name it any way

A URL, a domain, or a name someone published.

IV · What you can do now

One click installs

on your page, README or post

<a href="nzip:alice.example/devtools">
  Install devtools
</a>

🌳 Install devtools

→

bundle opens a window with the same review and the same questions.

No terminal needed

Once bundle is installed, the browser hands nzip: links to it.

Names, never downloads

A link names something published. A page can’t point bundle at any old file.

Apps, suites, plugins

A plugin’s link installs it into its app. publish prints the link.

IV · What you can do now

Staying current

$ bundle update
1 of 4 updated: tool

# a new terminal, the next morning:
tool: WARNING — scanner.example as malware has marked it bad since it was last checked

$ bundle installed tool
tool CHANGED the file is not the bytes that were installed

Releases move, you follow

An install remembers how it was named, and asks again.

A quiet daily check

At shell start, and silent when there’s nothing to say.

Changes get noticed

Whoever touched the file on disk.

IV · What you can do now

Team toolsets

$ bundle install @acme.com/devtools
* suite devtools expects its members to carry:
   1 signed by …/acme/cli/…/release.yml@refs/heads/main — for cli
   2 attested by published@did:plc:… — for cli-git, cli-k8s
accept which, for those members? all
suite devtools: 3 installed

# and IT pushes one rule to every laptop:
{ "require": { "attesters": ["permitted@did:web:it.acme.com"] } }

Asked once

Every tool is still reviewed on its own.

Kept in step

Tools added are installed, tools dropped are removed.

IT can say yes or no

Permit the suite, prohibit one tool in it.

IV · Back on the server

Deploying now

# /etc/bundle/policy.json
{ "require": { "attesters":
  ["published@did:plc:…"] } }

$ bundle install --system \
    --name example-shop \
    @you.example/shop

# each systemd unit:
example-shop run checkout

One app, every service a part

API, auth, workers, mail… each pinned by hash.

CI vouches for one hash

The servers only accept what that account attested.

Unchanged means untouched

Same bytes, same hash: not fetched, not restarted.

All or none

No half the services on last week’s release.

What’s on the server? One hash, and who vouched for it.

V · Why it matters

Then and now

Hard beforeNow
What’s on the server?One hash, and who vouched for it
Deploys that need the registryThe file is the release
Handing a colleague a CLIOne file that runs by name, or one click
Ten laptops in stepA suite, kept current by bundle update
Who vouches for it?Signatures and attestations you choose
Hearing about a compromiseYour next terminal tells you
Plugins as loose npm packagesSigned plugins, installed per app

V · Why it matters

Why care?

You can say what’s running

With a hash, on any server or laptop, months later.

You can share a tool

One file, one click, kept current. No support channel.

You choose whom to trust

See who vouches, and let your policy decide.

Built on Node itself: no new runtime, no new registry, no fork. You still develop with npm; this changes what you hand over.

V · Honestly

What this isn’t

Not stable

Node 26.11+ with --experimental-vfs. Both sides are experimental.

Not proof of safety

A signature says who built it. Review and attestations say the rest.

Not a replacement for npm

You still develop with npm. This changes what you hand over.

Try it tonight

Pack your tool

# get bundle (needs node 26.11.1+)
$ curl -LO https://github.com/pipobscure/bundles/releases/latest/download/bundle.nzip
$ node --experimental-vfs --vfs-load ./bundle.nzip install
# pack yours
$ BUNDLE_MANIFEST=app.manifest node --experimental-vfs -r @pipobscure/bundle/record --vfs-load=./app
$ bundle create --base ./app --files app.manifest --launcher --output app.unsigned.nzip
$ bundle sign app.unsigned.nzip && ./app.nzip
# share it, and vouch for it
$ bundle publish --as you.example --description 'my tool' app https://…/app.nzip
$ bundle attest --as you.example --kind audited app.nzip

Code & docs

github.com/pipobscure/bundles

Package

npm: @pipobscure/bundle

Say hi

@pipobscure.com

0:00