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)

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 requested a review from a team as a code owner April 25, 2026 03:06
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.

1 participant