@exodus/stasis

中文文档
1.0.0-rc.1发布于 2026/11/13MITTypeScriptES Module近 30 天下载 2788

File-level source bundles and lockfiles

原始使用文档
文档目录4 节
  1. Why a separate bundle format?
  2. Commands
  3. Runtime
  4. License

@exodus/stasis

Analyzeable source code bundles with resolutions + fine-grained lockfiles.

Node.js esbuild metro rollup webpack

Both lockfiles and bundles only include what is actually used.
Generally about 10x smaller than production-focused node_modules install.

Enforcing these lets you focus automated code scanning and alerts only on code that matters, and makes the analysis import graph aware.

Ideal workflow: create bundle -> analyze -> ship that exact bundle to production.

Lockfile can attest the bundle in a readable form, but that's not required - bundle itself can be an attestation.

LockfileBundle
stasis.lock.jsonstasis.code.br
Asserts per-file content integrity and the import graphContains per-file content (source) and the import graph
Human-readableCompressed
Asserts only, files are read from diskLoads or asserts (can be used as a lockfile)
Modes: add, replace, frozen, ignoreModes: load, add, replace, frozen, ignore

The main difference between lockfiles and bundles is that lockfiles contain integrities, and bundles contain full content.
See file formats.

Both can be run in full scope (default) or just in node_modules scope.

Why a separate bundle format?

StasisJS bundlersSourcemapsSEAsource + deps tarballContainers
Runnable✅✅❌✅✅✅
Contains original sources✅❌✅❌✅✅
Sources match runtime✅➖❌ Deps can misreport➖✅✅
Dependency versions✅❌❌❌✅✅
Import edges✅❌❌❌🔍 Implicit🔍 Implicit
Constrained to related code✅✅✅✅❌❌

Lockfiles (npm/pnpm/etc) not mentioned: they are like the "tarball" column, but also require network, install step and are not self-contained.

Commands

CommandWhat it does
stasis run --lock=add app.jsbuild just a lockfile
stasis run --lock=frozen app.jsverify disk against the lockfile
stasis run --bundle=add app.jsbuild just a bundle
stasis run --bundle=frozen app.jsverify disk against the bundle alone (self-attesting)
stasis run --bundle=load app.jsrun from the bundle alone
stasis run --lock=add --bundle=add app.jsbuild a lockfile and bundle together
stasis run --lock=frozen --bundle=load app.jsrun from the bundle, verified against the lockfile
stasis run --lock=add --bundle=add --mock app.jsbuild without the app's side effects (network, fs writes)
stasis run --lock=add --child-process app.jsalso attest modules loaded in forked child processes (e.g. Metro transform workers)
stasis run --bundle=add --fs=sync app.jsbuild a bundle that also captures sync fs.readFileSync/readdirSync reads
stasis run --lock=add --import=./instrument.mjs app.jsalso load a preload module; its own graph is runner infrastructure, not attested
stasis bundle src/index.jsbuild a bundle statically, without executing it
stasis bundle --add src/worker.jsmerge more entries into the existing bundle
stasis bundle --conditions=react-native,browser app.jsstatically bundle with extra exports/imports resolution conditions
stasis bundle --mainFields=react-native,browser,main app.jsstatically bundle honoring legacy package mainFields
stasis bundle --metro --platforms=ios,android app.jsstatically bundle the way Metro resolves, all platforms at once
stasis bundle --typescript src/index.tsstatically bundle TS sources, resolving ./x.js imports to ./x.ts as tsc does
stasis add src assetsadd files to the project's bundles as-is, with no dependency resolution
stasis github-bundle --github=owner/name --sha=<commit> src/index.jsstatically bundle a GitHub repo at a commit, with nothing installed
stasis build --output=out.js app.stasis.code.br [entry]rebuild a runnable JS bundle with esbuild, following the bundle's recorded import graph exactly
stasis build --output=out.js stasis.lock.json [entry]same, reading + verifying sources from disk against the lockfile
stasis build --platform=hermes --metro=ios --assets-dest=dist --output=main.js app.stasis.code.brbuild a --metro bundle for one platform as Metro does: its .ios files, assets as Metro's asset modules, their files copied out
stasis extract --lock=add app.stasis.code.brunpack a bundle back to sources + a stasis.lock.json
stasis diff --stat a.lock.json b.stasis.code.brsummarize module/file differences between two lockfiles/bundles
stasis prunetrim node_modules to the lockfile, verifying the rest
stasis audit stasis.lock.jsonreport advisories for a lockfile's or bundle's dependencies
stasis audit --why app.stasis.code.brsame, with the import chains that pull each flagged package in
stasis auditsame, for the bundle stasis bundle would build of stasis.config.json's entries, without writing it
stasis validate app.stasis.code.brcheck a bundle's own code against its repository and its dependencies against their published packages, held to its lockfile
stasis sbom --format=spdx stasis.lock.jsonexport an SPDX SBOM for a lockfile or bundle
stasis sbom --format=cyclonedx app.stasis.code.brexport a CycloneDX SBOM for a lockfile or bundle

Each command's options are documented in doc/: run, bundle (and add), github-bundle, build, extract, diff, prune, audit, validate, sbom. stasis bundle also bundles Solidity, PHP, Bash, Rust and TEAL sources, see file formats.

Runtime

The zero-dependency @exodus/stasis-core CLI provides the run, add, extract and prune commands only.
The bundler plugins live in @exodus/stasis-plugins.

License

MIT

版本与发布记录

@exodus/stasis 共发布 22 个版本,首次发布于 2026/05/19;过去 12 个月发布了 22 个版本。

版本发布日期距今
1.0.0-rc.1latest2026/11/131 天前
1.0.0-rc.02026/11/121 天前
1.0.0-beta.172026/11/121 天前
1.0.0-beta.162026/11/122 天前
1.0.0-beta.152026/11/0410 天前
1.0.0-beta.142026/11/0113 天前

关于 @exodus/stasis 的常见问题

@exodus/stasis 是什么?

File-level source bundles and lockfiles

如何安装 @exodus/stasis?

在项目目录运行 npm install @exodus/stasis,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 stasis,可以用 npx stasis 直接运行。

@exodus/stasis 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@exodus/stasis 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@exodus/stasis 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=24.14.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@exodus/stasis 可以商用吗?

@exodus/stasis 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@exodus/stasis 的下载量有多少?

根据 npm 官方下载统计,@exodus/stasis 在 2026/10/14 – 2026/11/12 这 30 天内被下载 2,788 次,日均约 93 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@exodus/stasis 还在维护吗?

最新版本 1.0.0-rc.1 发布于 2026/11/13(1 天前);至今共发布 22 个版本,其中过去 12 个月发布了 22 个;首次发布于 2026/05/19。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。