File tree Expand file tree Collapse file tree 4 files changed +17
-8
lines changed
node_modules/promise-call-limit Expand file tree Collapse file tree 4 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 1- const defLimit = require ( 'os' ) . cpus ( ) . length
1+ const os = require ( 'os' )
2+ // availableParallelism available only since node v19, for older versions use
3+ // cpus() cpus() can return an empty list if /proc is not mounted, use 1 in
4+ // this case
5+
6+ /* istanbul ignore next - version-specific workaround */
7+ const defLimit = 'availableParallelism' in os
8+ ? os . availableParallelism ( )
9+ : Math . max ( 1 , os . cpus ( ) . length )
10+
211const callLimit = ( queue , limit = defLimit ) => new Promise ( ( res , rej ) => {
312 let active = 0
413 let current = 0
Original file line number Diff line number Diff line change 11{
22 "name" : " promise-call-limit" ,
3- "version" : " 1.0.1 " ,
3+ "version" : " 1.0.2 " ,
44 "files" : [
55 " index.js"
66 ],
2121 "check-coverage" : true
2222 },
2323 "devDependencies" : {
24- "tap" : " ^14.10.6 "
24+ "tap" : " ^16.0.0 "
2525 },
2626 "funding" : {
2727 "url" : " https://github.com/sponsors/isaacs"
Original file line number Diff line number Diff line change 1020510205 }
1020610206 },
1020710207 "node_modules/promise-call-limit": {
10208- "version": "1.0.1 ",
10209- "resolved": "https://registry.npmjs.org/promise-call-limit/-/promise-call-limit-1.0.1 .tgz",
10210- "integrity": "sha512-3+hgaa19jzCGLuSCbieeRsu5C2joKfYn8pY6JAuXFRVfF4IO+L7UPpFWNTeWT9pM7uhskvbPPd/oEOktCn317Q ==",
10208+ "version": "1.0.2 ",
10209+ "resolved": "https://registry.npmjs.org/promise-call-limit/-/promise-call-limit-1.0.2 .tgz",
10210+ "integrity": "sha512-1vTUnfI2hzui8AEIixbdAJlFY4LFDXqQswy/2eOlThAscXCY4It8FdVuI0fMJGAB2aWGbdQf/gv0skKYXmdrHA ==",
1021110211 "funding": {
1021210212 "url": "https://github.com/sponsors/isaacs"
1021310213 }
1502615026 "parse-conflict-json": "^3.0.0",
1502715027 "proc-log": "^3.0.0",
1502815028 "promise-all-reject-late": "^1.0.0",
15029- "promise-call-limit": "^1.0.1 ",
15029+ "promise-call-limit": "^1.0.2 ",
1503015030 "read-package-json-fast": "^3.0.2",
1503115031 "semver": "^7.3.7",
1503215032 "ssri": "^10.0.1",
Original file line number Diff line number Diff line change 3030 "parse-conflict-json" : " ^3.0.0" ,
3131 "proc-log" : " ^3.0.0" ,
3232 "promise-all-reject-late" : " ^1.0.0" ,
33- "promise-call-limit" : " ^1.0.1 " ,
33+ "promise-call-limit" : " ^1.0.2 " ,
3434 "read-package-json-fast" : " ^3.0.2" ,
3535 "semver" : " ^7.3.7" ,
3636 "ssri" : " ^10.0.1" ,
You can’t perform that action at this time.
0 commit comments