Files
icehrm/lib/composer/vendor/consolidation/robo/docs/tasks/Npm.md
2017-09-03 20:39:22 +02:00

1.7 KiB

Npm Tasks

Install

Npm Install

<?php
// simple execution
$this->taskNpmInstall()->run();

// prefer dist with custom path
$this->taskNpmInstall('path/to/my/npm')
     ->noDev()
     ->run();
?>
  • noDev() adds production option to npm
  • dir($dir) Changes working directory of command
  • printed($arg) Should command output be printed
  • arg($arg) Pass argument to executable. Its value will be automatically escaped.
  • args($args) Pass methods parameters as arguments to executable. Argument values
  • rawArg($arg) Pass the provided string in its raw (as provided) form as an argument to executable.
  • option($option, $value = null) Pass option to executable. Options are prefixed with -- , value can be provided in second parameter.
  • optionList($option, $value = null) Pass multiple options to executable. Value can be a string or array.

Update

Npm Update

<?php
// simple execution
$this->taskNpmUpdate()->run();

// prefer dist with custom path
$this->taskNpmUpdate('path/to/my/npm')
     ->noDev()
     ->run();
?>
  • noDev() adds production option to npm
  • dir($dir) Changes working directory of command
  • printed($arg) Should command output be printed
  • arg($arg) Pass argument to executable. Its value will be automatically escaped.
  • args($args) Pass methods parameters as arguments to executable. Argument values
  • rawArg($arg) Pass the provided string in its raw (as provided) form as an argument to executable.
  • option($option, $value = null) Pass option to executable. Options are prefixed with -- , value can be provided in second parameter.
  • optionList($option, $value = null) Pass multiple options to executable. Value can be a string or array.