Jump to content

Node.js: Difference between revisions

522 bytes added ,  7 November 2018
introduce direnv as antoher possibility
imported>Samueldr
m (Samueldr moved page Node to Node.js: Actual name (https://en.wikipedia.org/wiki/Node.js))
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> ====
Anonymous user