rfcs icon indicating copy to clipboard operation
rfcs copied to clipboard

[RRFC] Parallel script execution when value is set to an array of text.

Open EvanCarroll opened this issue 3 years ago • 1 comments

Currently a script can not be set to array. Add this to your package.json,

  "scripts": {
    "foo": [
      "echo bar",
      "echo baz"
    ]
  },

Now if you try to run it,

npm run-script foo

You'll get

npm ERR! Missing script: "foo"
npm ERR! 
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ecarroll/.npm/_logs/2022-07-02T19_32_38_351Z-debug-0.log

The obvious intent here is to run two scripts where neither one is concerned with the status of another. This RFC would define the behavior of script with a member set to an array to,

  1. Run both scripts without regard for return codes of other scripts defined,
  2. Run both scripts in parallel.

EvanCarroll avatar Jul 02 '22 19:07 EvanCarroll

seems related to https://github.com/npm/rfcs/issues/190

ljharb avatar Oct 03 '22 18:10 ljharb