提交学习笔记专用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
3.3 KiB

  1. | index | [npm-run-all] | [run-s] | [run-p] | [Node API] |
  2. |-------|---------------|---------|---------|------------|
  3. # npm-run-all2
  4. [![npm version](https://img.shields.io/npm/v/npm-run-all2.svg)](https://www.npmjs.com/package/npm-run-all2)
  5. [![Downloads/month](https://img.shields.io/npm/dm/npm-run-all2.svg)](http://www.npmtrends.com/npm-run-all2)
  6. [![tests](https://github.com/bcomnes/npm-run-all2/workflows/tests/badge.svg)](https://github.com/bcomnes/npm-run-all2/actions)
  7. [![Coverage Status](https://codecov.io/gh/bcomnes/npm-run-all2/branch/master/graph/badge.svg)](https://codecov.io/gh/bcomnes/npm-run-all2)
  8. [![neostandard javascript style](https://img.shields.io/badge/code_style-neostandard-brightgreen?style=flat)](https://github.com/neostandard/neostandard)
  9. A CLI tool to run multiple npm-scripts in parallel or sequential.
  10. ## npm-run-all2 why?
  11. **A maintenance fork of npm-run-all.** npm-run-all2 is a fork of npm-run-all with dependabot updates, release automation enabled and some troublesome babel stuff removed to further reduce maintenance burden. Hopefully this labor can upstream some day when mysticatea returns, but until then, welcome aboard!
  12. ## ⤴️ Motivation
  13. - **Simplify.** The official `npm run-script` command cannot run multiple scripts, so if we want to run multiple scripts, it's redundant a bit. Let's shorten it by glob-like patterns.<br>
  14. Before: `npm run clean && npm run build:css && npm run build:js && npm run build:html`<br>
  15. After: `npm-run-all clean build:*`
  16. - **Cross platform.** We sometimes use `&` to run multiple command in parallel, but `cmd.exe` (`npm run-script` uses it by default) does not support the `&`. Half of Node.js users are using it on Windows, so the use of `&` might block contributions. `npm-run-all --parallel` works well on Windows as well.
  17. ## 💿 Installation
  18. ```bash
  19. $ npm install npm-run-all2 --save-dev
  20. # or
  21. $ yarn add npm-run-all2 --dev
  22. ```
  23. - It requires `Node@>=14`. It may work on older versions of Node, but no guarantees are given.
  24. ## 📖 Usage
  25. ### CLI Commands
  26. This `npm-run-all` package provides 3 CLI commands.
  27. - [npm-run-all]
  28. - [run-s]
  29. - [run-p]
  30. The main command is [npm-run-all].
  31. We can make complex plans with [npm-run-all] command.
  32. Both [run-s] and [run-p] are shorthand commands.
  33. [run-s] is for sequential, [run-p] is for parallel.
  34. We can make simple plans with those commands.
  35. #### Yarn / pnpm Compatibility
  36. `npm-run-all` is compatible with both Yarn and pnpm. If a script is invoked using either package manager, `npm-run-all` will correctly utilize it to execute the plan's child scripts.
  37. ### Node API
  38. This `npm-run-all` package provides Node API.
  39. - [Node API]
  40. ## 📰 Changelog
  41. - https://github.com/bcomnes/npm-run-all2/releases
  42. ## 🍻 Contributing
  43. Welcome♡
  44. ### Bug Reports or Feature Requests
  45. Please use GitHub Issues.
  46. ### Correct Documents
  47. Please use GitHub Pull Requests.
  48. I'm not familiar with English, so I especially thank you for documents' corrections.
  49. ### Implementing
  50. Please use GitHub Pull Requests.
  51. There are some npm-scripts to help developments.
  52. - **npm test** - Run tests and collect coverage.
  53. - **npm run clean** - Delete temporary files.
  54. - **npm run lint** - Run ESLint.
  55. - **npm run watch** - Run tests (not collect coverage) on every file change.
  56. [npm-run-all]: docs/npm-run-all.md
  57. [run-s]: docs/run-s.md
  58. [run-p]: docs/run-p.md
  59. [Node API]: docs/node-api.md