npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

running a npm script of “devDependencies” during the postinstall

I’ve done a script to launch during the postinstall phase of a build, It work wonderfully. My issue?

I want to put my script in a npm dependency in order to run it in any other npm project during the postinstall phase

how can I do that cleanly?

I was thinking of doing something like:

    postinstall:"node node_modules/myScript/run.js"

It work when it’s in the root project but it not when I reuse my project as a dependency

I was also thinking of something like: script:{ postinstall:“myScript” }

But I don’t know how to convert a npm project into a commandline tool

(just for info, running my script add new (non-npm)dependencies to the node_modules and convert them into npm standard dependencies)