When npm installs native node modules it uses node-gyp
to compile code. This is the seam node uses for targeting different operating systems, e.g. OS X
, linux
, Windows
etc.
By default node-gyp
compiles using one core and if you have more than one you probably want to utilize that power to speed up compile time. The way node-gyp
handles this is by using the JOBS
environment variable, which sets the jobs
variable here. This piece of code then checks the value of jobs
to determine how many cores to use.
Note that if the value of JOBS
is max
then all cores will be used. So lets try this on leveldown
. First lets check that JOBS
isn't set yet:
lms@ux301|01:34|~/src/leveldb-repos/leveldown (master) $ echo $JOBS