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:

script:{
    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)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.