@fireproof/vendor 0.23.3 → 0.23.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/p-limit/license +9 -0
- package/p-limit/package.json +59 -0
- package/p-limit/readme.md +128 -0
- package/package.json +2 -2
- package/tsconfig.json +21 -0
package/p-limit/license
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "p-limit",
|
|
3
|
+
"version": "6.2.0",
|
|
4
|
+
"description": "Run multiple promise-returning & async functions with limited concurrency",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "sindresorhus/p-limit",
|
|
7
|
+
"funding": "https://github.com/sponsors/sindresorhus",
|
|
8
|
+
"author": {
|
|
9
|
+
"name": "Sindre Sorhus",
|
|
10
|
+
"email": "sindresorhus@gmail.com",
|
|
11
|
+
"url": "https://sindresorhus.com"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"exports": {
|
|
15
|
+
"types": "./index.d.ts",
|
|
16
|
+
"default": "./index.js"
|
|
17
|
+
},
|
|
18
|
+
"sideEffects": false,
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=18"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "echo vendor need this",
|
|
24
|
+
"test": "xo && ava && tsd"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"index.js",
|
|
28
|
+
"index.d.ts"
|
|
29
|
+
],
|
|
30
|
+
"keywords": [
|
|
31
|
+
"promise",
|
|
32
|
+
"limit",
|
|
33
|
+
"limited",
|
|
34
|
+
"concurrency",
|
|
35
|
+
"throttle",
|
|
36
|
+
"throat",
|
|
37
|
+
"rate",
|
|
38
|
+
"batch",
|
|
39
|
+
"ratelimit",
|
|
40
|
+
"task",
|
|
41
|
+
"queue",
|
|
42
|
+
"async",
|
|
43
|
+
"await",
|
|
44
|
+
"promises",
|
|
45
|
+
"bluebird"
|
|
46
|
+
],
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"yocto-queue": "^1.2.1"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"ava": "^6.1.3",
|
|
52
|
+
"delay": "^6.0.0",
|
|
53
|
+
"in-range": "^3.0.0",
|
|
54
|
+
"random-int": "^3.0.0",
|
|
55
|
+
"time-span": "^5.1.0",
|
|
56
|
+
"tsd": "^0.31.1",
|
|
57
|
+
"xo": "^0.58.0"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# p-limit
|
|
2
|
+
|
|
3
|
+
> Run multiple promise-returning & async functions with limited concurrency
|
|
4
|
+
|
|
5
|
+
_Works in Node.js and browsers._
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install p-limit
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
import pLimit from "p-limit";
|
|
17
|
+
|
|
18
|
+
const limit = pLimit(1);
|
|
19
|
+
|
|
20
|
+
const input = [limit(() => fetchSomething("foo")), limit(() => fetchSomething("bar")), limit(() => doSomething())];
|
|
21
|
+
|
|
22
|
+
// Only one promise is run at once
|
|
23
|
+
const result = await Promise.all(input);
|
|
24
|
+
console.log(result);
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## API
|
|
28
|
+
|
|
29
|
+
### pLimit(concurrency) <sup>default export</sup>
|
|
30
|
+
|
|
31
|
+
Returns a `limit` function.
|
|
32
|
+
|
|
33
|
+
#### concurrency
|
|
34
|
+
|
|
35
|
+
Type: `number`\
|
|
36
|
+
Minimum: `1`
|
|
37
|
+
|
|
38
|
+
Concurrency limit.
|
|
39
|
+
|
|
40
|
+
### limit(fn, ...args)
|
|
41
|
+
|
|
42
|
+
Returns the promise returned by calling `fn(...args)`.
|
|
43
|
+
|
|
44
|
+
#### fn
|
|
45
|
+
|
|
46
|
+
Type: `Function`
|
|
47
|
+
|
|
48
|
+
Promise-returning/async function.
|
|
49
|
+
|
|
50
|
+
#### args
|
|
51
|
+
|
|
52
|
+
Any arguments to pass through to `fn`.
|
|
53
|
+
|
|
54
|
+
Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a _lot_ of functions.
|
|
55
|
+
|
|
56
|
+
### limit.activeCount
|
|
57
|
+
|
|
58
|
+
The number of promises that are currently running.
|
|
59
|
+
|
|
60
|
+
### limit.pendingCount
|
|
61
|
+
|
|
62
|
+
The number of promises that are waiting to run (i.e. their internal `fn` was not called yet).
|
|
63
|
+
|
|
64
|
+
### limit.clearQueue()
|
|
65
|
+
|
|
66
|
+
Discard pending promises that are waiting to run.
|
|
67
|
+
|
|
68
|
+
This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app.
|
|
69
|
+
|
|
70
|
+
Note: This does not cancel promises that are already running.
|
|
71
|
+
|
|
72
|
+
### limit.concurrency
|
|
73
|
+
|
|
74
|
+
Get or set the concurrency limit.
|
|
75
|
+
|
|
76
|
+
### limitFunction(fn, options) <sup>named export</sup>
|
|
77
|
+
|
|
78
|
+
Returns a function with limited concurrency.
|
|
79
|
+
|
|
80
|
+
The returned function manages its own concurrent executions, allowing you to call it multiple times without exceeding the specified concurrency limit.
|
|
81
|
+
|
|
82
|
+
Ideal for scenarios where you need to control the number of simultaneous executions of a single function, rather than managing concurrency across multiple functions.
|
|
83
|
+
|
|
84
|
+
```js
|
|
85
|
+
import { limitFunction } from "p-limit";
|
|
86
|
+
|
|
87
|
+
const limitedFunction = limitFunction(
|
|
88
|
+
async () => {
|
|
89
|
+
return doSomething();
|
|
90
|
+
},
|
|
91
|
+
{ concurrency: 1 },
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
const input = Array.from({ length: 10 }, limitedFunction);
|
|
95
|
+
|
|
96
|
+
// Only one promise is run at once.
|
|
97
|
+
await Promise.all(input);
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
#### fn
|
|
101
|
+
|
|
102
|
+
Type: `Function`
|
|
103
|
+
|
|
104
|
+
Promise-returning/async function.
|
|
105
|
+
|
|
106
|
+
#### options
|
|
107
|
+
|
|
108
|
+
Type: `object`
|
|
109
|
+
|
|
110
|
+
#### concurrency
|
|
111
|
+
|
|
112
|
+
Type: `number`\
|
|
113
|
+
Minimum: `1`
|
|
114
|
+
|
|
115
|
+
Concurrency limit.
|
|
116
|
+
|
|
117
|
+
## FAQ
|
|
118
|
+
|
|
119
|
+
### How is this different from the [`p-queue`](https://github.com/sindresorhus/p-queue) package?
|
|
120
|
+
|
|
121
|
+
This package is only about limiting the number of concurrent executions, while `p-queue` is a fully featured queue implementation with lots of different options, introspection, and ability to pause the queue.
|
|
122
|
+
|
|
123
|
+
## Related
|
|
124
|
+
|
|
125
|
+
- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning & async functions
|
|
126
|
+
- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions
|
|
127
|
+
- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency
|
|
128
|
+
- [More…](https://github.com/sindresorhus/promise-fun)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fireproof/vendor",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.5",
|
|
4
4
|
"description": "vendor patch repo to support esm",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"author": "",
|
|
15
15
|
"license": "AFL-2.0",
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@fireproof/core-cli": "0.23.
|
|
17
|
+
"@fireproof/core-cli": "0.23.5",
|
|
18
18
|
"@types/jscodeshift": "^17.3.0",
|
|
19
19
|
"cmd-ts": "^0.13.0",
|
|
20
20
|
"jscodeshift": "^17.1.1",
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": [
|
|
3
|
+
"/home/runner/work/fireproof/fireproof/tsconfig.dist.json"
|
|
4
|
+
],
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"allowJs": true,
|
|
7
|
+
"outDir": "../npm/",
|
|
8
|
+
"noEmit": false
|
|
9
|
+
},
|
|
10
|
+
"include": [
|
|
11
|
+
"**/*.ts",
|
|
12
|
+
"**/*.js",
|
|
13
|
+
"**/*"
|
|
14
|
+
],
|
|
15
|
+
"exclude": [
|
|
16
|
+
"node_modules",
|
|
17
|
+
"dist",
|
|
18
|
+
".git",
|
|
19
|
+
".vscode"
|
|
20
|
+
]
|
|
21
|
+
}
|