Skip to content

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

@lachlanhunt

Description

@lachlanhunt

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.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions