help.js 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /**
  2. * @author Toru Nagashima
  3. * @copyright 2015 Toru Nagashima. All rights reserved.
  4. * See LICENSE file in root directory for full license.
  5. */
  6. 'use strict'
  7. // ------------------------------------------------------------------------------
  8. // Public Interface
  9. // ------------------------------------------------------------------------------
  10. /**
  11. * Print a help text.
  12. *
  13. * @param {stream.Writable} output - A writable stream to print.
  14. * @returns {Promise} Always a fulfilled promise.
  15. * @private
  16. */
  17. module.exports = function printHelp (output) {
  18. output.write(`
  19. Usage:
  20. $ npm-run-all [--help | -h | --version | -v]
  21. $ npm-run-all [tasks] [OPTIONS]
  22. Run given npm-scripts in parallel or sequential.
  23. <tasks> : A list of npm-scripts' names and Glob-like patterns.
  24. Options:
  25. --aggregate-output - - - Avoid interleaving output by delaying printing of
  26. each command's output until it has finished.
  27. -c, --continue-on-error - Set the flag to continue executing
  28. other/subsequent tasks even if a task threw an
  29. error. 'npm-run-all' itself will exit with
  30. non-zero code if one or more tasks threw error(s)
  31. --max-parallel <number> - Set the maximum number of parallelism. Default is
  32. unlimited.
  33. --npm-path <string> - - - Set the path to npm. Default is the value of
  34. environment variable npm_execpath.
  35. If the variable is not defined, then it's "npm".
  36. In this case, the "npm" command must be found in
  37. environment variable PATH.
  38. -l, --print-label - - - - Set the flag to print the task name as a prefix
  39. on each line of output. Tools in tasks may stop
  40. coloring their output if this option was given.
  41. -n, --print-name - - - - Set the flag to print the task name before
  42. running each task.
  43. -p, --parallel <tasks> - Run a group of tasks in parallel.
  44. e.g. 'npm-run-all -p foo bar' is similar to
  45. 'npm run foo & npm run bar'.
  46. -r, --race - - - - - - - Set the flag to kill all tasks when a task
  47. finished with zero. This option is valid only
  48. with 'parallel' option.
  49. -s, --sequential <tasks> - Run a group of tasks sequentially.
  50. --serial <tasks> e.g. 'npm-run-all -s foo bar' is similar to
  51. 'npm run foo && npm run bar'.
  52. '--serial' is a synonym of '--sequential'.
  53. --silent - - - - - - - - Set 'silent' to the log level of npm.
  54. Examples:
  55. $ npm-run-all --serial clean lint build:**
  56. $ npm-run-all --parallel watch:**
  57. $ npm-run-all clean lint --parallel "build:** -- --watch"
  58. $ npm-run-all -l -p start-server start-browser start-electron
  59. See Also:
  60. https://github.com/mysticatea/npm-run-all#readme
  61. `)
  62. return Promise.resolve(null)
  63. }