diff options
author | isaacs <i@izs.me> | 2021-06-03 22:59:07 +0300 |
---|---|---|
committer | Gar <gar+gh@danger.computer> | 2021-06-10 20:10:35 +0300 |
commit | a4a0e68a9e34a4c99e10e4fb8c5f89d323a4192f (patch) | |
tree | ce5c982c758a762b9980fc6a087031bd8953ce75 /node_modules/promise-call-limit | |
parent | f130a81d62bf4f540ab252a09ff5a618827f9265 (diff) |
chore: check less stuff into node_modules
We bundle our deps, but we don't need to bundle docs, changelogs,
editorconfigs, test coverage reports, .github workflow definitions,
lint configurations, and all the rest, which we never use.
This cuts about 10% off of our publish artifact file size.
```
$ ls -laF npm-7.16.0-*.tgz
-rw-r--r-- 1 isaacs staff 7174497 Jun 3 13:01 npm-7.16.0-release-next.tgz
-rw-r--r-- 1 isaacs staff 6782377 Jun 3 13:00 npm-7.16.0-trim-node-modules.tgz
$ ls -laF npm-7.16.0-*.tar
-rw-r--r-- 1 isaacs staff 19020288 Jun 3 13:01 npm-7.16.0-release-next.tar
-rw-r--r-- 1 isaacs staff 17474048 Jun 3 13:00 npm-7.16.0-trim-node-modules.tar
```
PR-URL: https://github.com/npm/cli/pull/3362
Credit: @isaacs
Close: #3362
Reviewed-by: @nlf
Diffstat (limited to 'node_modules/promise-call-limit')
-rw-r--r-- | node_modules/promise-call-limit/README.md | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/node_modules/promise-call-limit/README.md b/node_modules/promise-call-limit/README.md deleted file mode 100644 index eae5de8ce..000000000 --- a/node_modules/promise-call-limit/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# promise-call-limit - -Call an array of promise-returning functions, restricting concurrency to a -specified limit. - -## USAGE - -```js -const promiseCallLimit = require('promise-call-limit') -const things = getLongListOfThingsToFrobulate() - -// frobulate no more than 4 things in parallel -promiseCallLimit(things.map(thing => () => frobulateThing(thing)), 4) - .then(results => console.log('frobulated 4 at a time', results)) -``` - -## API - -### promiseCallLimit(queue Array<() => Promise>, limit = defaultLimit) - -The default limit is the number of CPUs on the system - 1, or 1. - -The reason for subtracting one is that presumably the main thread is taking -up a CPU as well, so let's not be greedy. - -Note that the array should be a list of Promise-_returning_ functions, not -Promises themselves. If you have a bunch of Promises already, you're best -off just calling `Promise.all()`. - -The functions in the queue are called without any arguments. |