Skip to content
This repository was archived by the owner on Jan 20, 2022. It is now read-only.

feat(reify): add the ability to add a hook - #342

Closed
ylemkimon wants to merge 1 commit into
npm:mainfrom
ylemkimon:hooks
Closed

ylemkimon wants to merge 1 commit into
npm:mainfrom
ylemkimon:hooks

Conversation

@ylemkimon

@ylemkimon ylemkimon commented Oct 23, 2021 •

Copy link
Copy Markdown

This PR adds the ability to add a hook via options.hook. It adds a single hook options.hook[Symbol.for('beforeReify')](Arborist), that runs after this[_loadTrees]() but before this[_reifyPackages](options). Other hook can be added later, with backward compatability.

Sometimes in a project, there is a need to enforce some policies on dependencies used in the project or mutate the tree. However, npm or Arborist doesn't provide a way to hook into its process.

References

Related to npm/rfcs#460

Other package managers

@ylemkimon
ylemkimon force-pushed the hooks branch 2 times, most recently from c8d00d2 to 85d3ed2 Compare October 23, 2021 11:12
@fritzy

fritzy commented Jan 19, 2022

Copy link
Copy Markdown

@ylemkimon
This repo will be archived soon. arborist is now maintained as a workspace in the CLI, but still published as its own library.
I have created a new PR at npm/cli#4260, which maintains you as the commit author.

@fritzy fritzy closed this Jan 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants