Skip to content

feat(arborist): add lockfileString() for in-memory lockfile generation#9282

Open
ljharb wants to merge 1 commit intonpm:latestfrom
ljharb:expose-lockfile-string
Open

feat(arborist): add lockfileString() for in-memory lockfile generation#9282
ljharb wants to merge 1 commit intonpm:latestfrom
ljharb:expose-lockfile-string

Conversation

@ljharb
Copy link
Copy Markdown
Contributor

@ljharb ljharb commented Apr 25, 2026

Exposes a public method on the Arborist class that builds (or reuses) an ideal tree, commits the shrinkwrap metadata, and returns the lockfile contents as a string without writing to disk.

This makes a previously-undocumented sequence (buildIdealTree() -> tree.meta.commit() -> String(tree.meta)) a discoverable, supported API, enabling callers to inspect, diff, or store generated lockfiles without mutating the project's package-lock.json.

(specifically, this is the only thing i need to be able to completely EOL https://npmjs.com/npm-lockfile)

@ljharb ljharb requested a review from a team as a code owner April 25, 2026 03:06
Comment thread workspaces/arborist/lib/arborist/index.js Outdated
Comment thread workspaces/arborist/lib/arborist/index.js Outdated
Comment thread workspaces/arborist/test/arborist/index.js Outdated
@ljharb ljharb force-pushed the expose-lockfile-string branch from 998444f to b683513 Compare May 4, 2026 23:43
Exposes a public method on the Arborist class that builds (or reuses) an ideal tree, commits the shrinkwrap metadata, and returns the lockfile contents as a string without writing to disk.

This makes a previously-undocumented sequence (`buildIdealTree()` -> `tree.meta.commit()` -> `String(tree.meta)`) a discoverable, supported API, enabling callers to inspect, diff, or store generated lockfiles without mutating the project's package-lock.json.
@ljharb ljharb force-pushed the expose-lockfile-string branch from b683513 to 3ccc030 Compare May 4, 2026 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants