Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide solution to link npm hook scripts in node_modules/.hooks #4

Closed
lachlanhunt opened this issue May 7, 2019 · 5 comments
Closed
Assignees

Comments

@lachlanhunt
Copy link

NPM already provides the hook scripts feature, which allows executable scipts to be placed in node_modules/.hooks/ and have them run for npm lifecycle events. But as far as I'm aware, there's currently no easy way for a package to link their hook scripts in this way, except by manually doing the work or writing a custom script to do it.

It would be extremely useful if npm provided a "hooks" field in package.json, similar to the existing "bin" field, which provides a way to specify paths to scripts that should be linked from the .hooks directory.

I will contribute a PR shortly to implement this.

@morficus
Copy link

I would love to see this in npm.

@darcyclarke
Copy link

@lachlanhunt I just responded to your tweet & also added myself & @isaacs as reviewers to this PR (yesterday). You should have feedback by EOW or early next week &, as mentioned in my response on Twitter, we may or may not be able to land this in the next npm minor release.

@isaacs
Copy link
Contributor

isaacs commented Aug 28, 2019

This should go through an RFC process, since it adds a new package field and a new bit of behavior that other CLI implementations would benefit from supporting.

@lachlanhunt
Copy link
Author

I've submitted a PR with an RFC.

@settings settings bot removed the enhancement label Dec 9, 2019
@wraithgar
Copy link
Member

Closing, hooks are not part of the npm scripts anymore

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 a pull request may close this issue.

5 participants