javascript - Best way to test global npm modules -
lets develop global npm module called mytool registers env variable through "bin" in package.json name mytool.
so after install globally typing
npm install mytool -g then can type mytool --someoption in terminal , handle cli input in javascript. lets assume mytool works lot current working directory of cli, just
node index.js --someoption is bad idea.
however test bugs don't want push new version of "mytool" npm , install globally npm. rather want able test locally.
question: best way test global npm modules without publishing npm?
npm link
contrary seems, npm link can used in case, too.
using in package folder "will create symlink in global folder {prefix}/lib/node_modules/<package> links package npm link command executed."
"it link bins in package {prefix}/bin/{name}."
Comments
Post a Comment