@packall/core
v0.5.4
Published
Registry-agnostic engine that resolves, downloads, verifies and packages an npm dependency closure for offline import.
Maintainers
Readme
@packall/core
The registry-agnostic engine behind packall. It resolves package specs, walks their
dependency closures, verifies downloads, and writes registry-shaped bundle artifacts.
The engine does not know how a registry speaks HTTP: that boundary is the Registry
service.
Install
npm install @packall/core effecteffect is a peer dependency. The default entry point is browser-safe. Node-specific
archive support is available explicitly from @packall/core/node.
Registry service
Implement or provide Registry when embedding the engine. A registry backend supplies
three operations:
preflightchecks that the registry is reachable.packument(name)reads package metadata and published versions.download(manifest)returns the tarball bytes for a resolved package.
The engine then handles resolution, lockfile pinning, platform filtering, integrity verification, progress reporting, manifests, layouts, and archive planning.
Bundle from code
import * as Effect from "effect/Effect";
import { bundle, defaultBundleOptions, parseSpec, Registry } from "@packall/core";
const program = Effect.gen(function* () {
// The surrounding Effect runtime provides Registry, Progress, filesystem,
// crypto, and the Node archive layer.
yield* Registry;
return yield* bundle([parseSpec("[email protected]")], {
...defaultBundleOptions,
outDir: "./bundles",
toolVersion: "example",
});
});In practice, compose the program with an Effect layer that provides Registry,
Progress, and the archive backend. The public API also exposes plan, resolve,
resolveLocked, bundleLocked, input-file parsing, lockfile parsing, and manifest
helpers for applications that need more control than bundle provides.
See the packall documentation and the
@packall/core API reference for the full
typed surface.
License
MIT
