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

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

Closed
wants to merge 1 commit into from

Conversation

ylemkimon
Copy link

@ylemkimon ylemkimon commented Oct 23, 2021

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

@fritzy
Copy link
Contributor

fritzy commented Jan 19, 2022

@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