Node.js: Difference between revisions
imported>Samueldr |
imported>Zauberpony introduce direnv as antoher possibility |
||
Line 50: | Line 50: | ||
Usage: uglifyjs [options] [files...] | Usage: uglifyjs [options] [files...] | ||
</pre> | </pre> | ||
===== direnv ===== | |||
If calling the executables with full path is too cumbersome, another elegant solution is to leverage [https://direnv.net/ direnv]. Direnv is a shell-hook that can set directory-specific environment-variables. You basically add a file ".envrc" next to your "package.json" with the following content: | |||
<pre> | |||
layout node | |||
</pre> | |||
direnv then adds your "node_modules/.bin" to your path whenever you enter the directory. Please follow direnv's setup instructions on how to activate setup direnv in general. | |||
==== Using <code>npx</code> ==== | ==== Using <code>npx</code> ==== |