How to use npm-run-all - 3 common examples

To help you get started, we’ve selected a few npm-run-all examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ManifoldScholar / manifold / client / script / tasks / start.js View on Github external
import runAll from 'npm-run-all';

if (__DEVELOPMENT__) {
  // We need to clean our builds first, and then build the shared vendor DLL.
  const runList = [
    "clean-builds",
    "build-universal-dll"
  ];
  runAll(runList, { parallel: false, stdout: process.stdout })
    .then(() => {
      // Once those are built, we can build server code and start servers. The universal
      // library we're using will wait to start the srevers until the server code exists,
      // which is why these can be run in parallel.
      const parallelRunList = [
        "build-server-react",
        "build-server-web",
        "server-react",
        "server-assets",
        "server-web"
      ];
      runAll(parallelRunList, { parallel: true, stdout: process.stdout });
    }, (e) => {
      console.log(e, 'One of the development NPM tasks in ./script/tasks/start.js failed');
    });
} else {
github ManifoldScholar / manifold / client / script / tasks / start.js View on Github external
.then(() => {
      // Once those are built, we can build server code and start servers. The universal
      // library we're using will wait to start the srevers until the server code exists,
      // which is why these can be run in parallel.
      const parallelRunList = [
        "build-server-react",
        "build-server-web",
        "server-react",
        "server-assets",
        "server-web"
      ];
      runAll(parallelRunList, { parallel: true, stdout: process.stdout });
    }, (e) => {
      console.log(e, 'One of the development NPM tasks in ./script/tasks/start.js failed');
github nrwl / nx / packages / workspace / src / tasks-runner / default-tasks-runner.spec.ts View on Github external
it('should run emit task complete events when "run-all-prerender" resolves', done => {
    runAll.mockImplementation(() => Promise.resolve());
    let i = 0;
    const expected = [
      {
        task: tasks[0],
        type: AffectedEventType.TaskComplete,
        success: true
      },
      {
        task: tasks[1],
        type: AffectedEventType.TaskComplete,
        success: true
      }
    ];
    defaultTaskRunner(tasks, {}, context).subscribe({
      next: event => {
        expect(event).toEqual(expected[i++]);

npm-run-all

A CLI tool to run multiple npm-scripts in parallel or sequential.

MIT
Latest version published 6 years ago

Package Health Score

76 / 100
Full package analysis

Popular npm-run-all functions