Post-install script for npm(1) which makes a component to be a valid npm module
Post-install script for
npm(1) which makes a component to be a valid node module.
It loops through a packages installed in a
node_modules dir and creates additional
files effectively aliasing short component names with names created by
Please note! Post install scripts are considered to be a bad practice. In this concrete case there should not be any practical downside. Nevertheless it is a break for convention. For example, some tool might be confused. So, please, you use this script only for private needs or as a temporary hack.
Just create a
package.json for the component you want to publish and specify
component-npm-post-install as a post install script.
As a result you will have addional
quux.js files in
They have a form of:
For this to work every npm package must include
npm install component-npm-post-install
Another way to consume components from node is to require them.