There are a lot of github repositories with node modules.
Some of them published as NPM package and i can install it via npm install <module>
.
And sometimes github contains only sources, and in package.json
i can see "prepublish": "npm run build"
and to NPM gets the bundles;
Also i have possibility to get module from github repository (npm install <project>/<resository>
), but by default to node_modules
gets sources and then i have to build it manually (for ex: npm run build
). There is any option to get sources from Github and then build it immediately?
Thanks!
NPM will automatically run the lifecycle steps regardless of it being from Github, another SVC system or NPM. See the lifecycle scripts you can put your build processes in here. Whatever project you want to install from Github will have already put their build process in the appropriate NPM scripts. Note that NPM has changed how and when these scripts are executed on each of the last 4 versions of NPM.
Run
npm i "jameswomack/string-is-empty#git-install-npm" -SE
on your project and see that it works.See the test repo that installed from Github here
See the test NPM package branch that outputs froma lifecycle script and was installed from Github here