A collection of commands that work with node.js

The node commands uses nvm, so that need to be installed yo use them.

In some cases, like in jenkins, you need to source nvm to get it to work, like i jenkins. You could do it like this:

source /var/lib/jenkins/.nvm/nvm.sh > /dev/null 2>&1

node:npm-install

This install all node dependencies that are in package.json

dropcat npm:install

Options

-nd, --nvm-dir=NVM-DIR  NVM directory
-nc, --nvmrc[=NVMRC]    Path to .nvmrc file

Yaml config

node:
  nvm_directory: /home/myuser/.nvm
  nvmrc: path/to/.nvmrc

node:yarn-install

This install all node dependencies that are in package.json using yarn.

dropcat yarn:install

Options

-nd, --nvm-dir=NVM-DIR  NVM directory
-nc, --nvmrc[=NVMRC]    Path to .nvmrc file

Yaml config

node:
  nvm_directory: /home/myuser/.nvm
  nvmrc: path/to/.nvmrc

node:gulp

Runs gulp.

With the option --gulp-options you could add commands that should run together with gulp, like compile --stage.

dropcat node:gulp

Options

-gd, --gulp-dir=GULP-DIR            Directory with gulpfile
-nd, --nvm-dir=NVM-DIR              NVM directory
-nc, --nvmrc[=NVMRC]                Path to .nvmrc file
-go, --gulp-options[=GULP-OPTIONS]  Gulp options
-ne, --node-env[=NODE-ENV]          Node environment

Yaml config

node:
  nvm_directory: /home/myuser/.nvm
  nvmrc: path/to/.nvmrc
  gulp_options: compile --prod
  environment: STAGE
  gulp_directory: mydir