@breautek/storm 5.0.1 → 5.0.2
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/CHANGELOG.md +10 -2
- package/docs/assets/highlight.css +85 -0
- package/docs/assets/main.js +58 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1367 -0
- package/docs/classes/Application.html +1235 -0
- package/docs/classes/BackendAuthenticationMiddleware.html +191 -0
- package/docs/classes/CORSMiddleware.html +257 -0
- package/docs/classes/ConfigLoader.html +166 -0
- package/docs/classes/Database.html +340 -0
- package/docs/classes/DatabaseCastObject.html +203 -0
- package/docs/classes/DatabaseConnection.html +550 -0
- package/docs/classes/DatabaseQueryError.html +372 -0
- package/docs/classes/DeadLockError.html +372 -0
- package/docs/classes/DiskSpaceError.html +362 -0
- package/docs/classes/DropTemporaryTableQuery.html +285 -0
- package/docs/classes/DumpStream.html +161 -0
- package/docs/classes/DuplicateEntryError.html +366 -0
- package/docs/classes/EntityNotFoundError.html +362 -0
- package/docs/classes/ExpiredTokenError.html +362 -0
- package/docs/classes/Handler.html +395 -0
- package/docs/classes/InternalError.html +362 -0
- package/docs/classes/InvalidCredentialsError.html +362 -0
- package/docs/classes/InvalidValueError.html +373 -0
- package/docs/classes/LineString.html +212 -0
- package/docs/classes/LockWaitTimeoutError.html +372 -0
- package/docs/classes/ManagedDatabaseConnection.html +410 -0
- package/docs/classes/Middleware.html +202 -0
- package/docs/classes/MissingConfigError.html +362 -0
- package/docs/classes/MissingParameterError.html +362 -0
- package/docs/classes/MySQLConnection.html +546 -0
- package/docs/classes/MySQLDatabase.html +353 -0
- package/docs/classes/NotImplementedError.html +362 -0
- package/docs/classes/Point.html +214 -0
- package/docs/classes/Polygon.html +212 -0
- package/docs/classes/Query.html +312 -0
- package/docs/classes/RawError.html +374 -0
- package/docs/classes/RawQuery.html +305 -0
- package/docs/classes/Request.html +375 -0
- package/docs/classes/Response.html +329 -0
- package/docs/classes/ResponseData.html +255 -0
- package/docs/classes/ServiceProvider.html +385 -0
- package/docs/classes/ServiceResponse.html +213 -0
- package/docs/classes/SetSessionVariableQuery.html +285 -0
- package/docs/classes/StormError.html +377 -0
- package/docs/classes/TemporaryTableQuery.html +290 -0
- package/docs/classes/Token.html +181 -0
- package/docs/classes/TokenManager.html +233 -0
- package/docs/classes/Transaction.html +267 -0
- package/docs/classes/UnauthorizedAccessError.html +362 -0
- package/docs/enums/ErrorCode.html +210 -0
- package/docs/enums/ExitCode.html +161 -0
- package/docs/enums/HTTPMethod.html +175 -0
- package/docs/enums/IsolationLevel.html +175 -0
- package/docs/enums/JWTError.html +161 -0
- package/docs/enums/StatusCode.html +483 -0
- package/docs/functions/formidable-1.html +143 -0
- package/docs/functions/getInstance.html +138 -0
- package/docs/index.html +224 -0
- package/docs/interfaces/IAdditionalErrorDetails.html +140 -0
- package/docs/interfaces/IAuthTokenData.html +172 -0
- package/docs/interfaces/IConfig.html +225 -0
- package/docs/interfaces/IDatabaseConfig.html +198 -0
- package/docs/interfaces/IDatabaseConnection.html +332 -0
- package/docs/interfaces/IErrorResponse.html +186 -0
- package/docs/interfaces/IFormData.html +165 -0
- package/docs/interfaces/IHandler.html +171 -0
- package/docs/interfaces/IInsertQueryResult.html +172 -0
- package/docs/interfaces/IJWTVerifyOptions.html +158 -0
- package/docs/interfaces/IParameterMap.html +140 -0
- package/docs/interfaces/IQueryable.html +233 -0
- package/docs/interfaces/IRequestResponse.html +172 -0
- package/docs/interfaces/IServiceHeaders.html +140 -0
- package/docs/interfaces/ISetSessionVariableQueryInput.html +165 -0
- package/docs/interfaces/ITemporaryTableQueryInput.html +165 -0
- package/docs/interfaces/IUpdateQueryResult.html +165 -0
- package/docs/interfaces/formidable.EmitData.html +180 -0
- package/docs/interfaces/formidable.EventData.html +201 -0
- package/docs/interfaces/formidable.Fields.html +141 -0
- package/docs/interfaces/formidable.File.html +239 -0
- package/docs/interfaces/formidable.FileJSON.html +238 -0
- package/docs/interfaces/formidable.Files.html +141 -0
- package/docs/interfaces/formidable.Options.html +308 -0
- package/docs/interfaces/formidable.Part.html +691 -0
- package/docs/modules/formidable.html +159 -0
- package/docs/types/IDeleteQueryResult.html +134 -0
- package/docs/types/IHandlerError.html +139 -0
- package/docs/types/IHandlerResponse.html +145 -0
- package/docs/types/TCoordinate.html +134 -0
- package/docs/types/formidable.BufferEncoding.html +135 -0
- package/docs/types/formidable.DefaultOptions.html +135 -0
- package/docs/types/formidable.EnabledPlugins.html +135 -0
- package/docs/types/formidable.EventNames.html +135 -0
- package/docs/types/formidable.MappedParsers.html +135 -0
- package/docs/types/formidable.Plugin.html +135 -0
- package/docs/types/formidable.PluginFunction.html +150 -0
- package/docs/types/formidable.Plugins.html +135 -0
- package/lib/StatusCode.d.ts +1 -1
- package/lib/StatusCode.js +1 -1
- package/lib/Transaction.d.ts +4 -0
- package/lib/Transaction.js +4 -0
- package/lib/Transaction.js.map +1 -1
- package/package.json +14 -14
- package/src/StatusCode.ts +1 -1
- package/src/Transaction.ts +4 -0
- package/docs/README.md +0 -188
- package/docs/classes/Application.md +0 -1648
- package/docs/classes/BackendAuthenticationMiddleware.md +0 -49
- package/docs/classes/CORSMiddleware.md +0 -143
- package/docs/classes/ConfigLoader.md +0 -29
- package/docs/classes/Database.md +0 -259
- package/docs/classes/DatabaseCastObject.md +0 -79
- package/docs/classes/DatabaseConnection.md +0 -556
- package/docs/classes/DatabaseQueryError.md +0 -351
- package/docs/classes/DeadLockError.md +0 -349
- package/docs/classes/DiskSpaceError.md +0 -341
- package/docs/classes/DropTemporaryTableQuery.md +0 -207
- package/docs/classes/DumpStream.md +0 -23
- package/docs/classes/DuplicateEntryError.md +0 -343
- package/docs/classes/EntityNotFoundError.md +0 -341
- package/docs/classes/ExpiredTokenError.md +0 -341
- package/docs/classes/Handler.md +0 -302
- package/docs/classes/InternalError.md +0 -341
- package/docs/classes/InvalidCredentialsError.md +0 -341
- package/docs/classes/InvalidValueError.md +0 -349
- package/docs/classes/LineString.md +0 -101
- package/docs/classes/LockWaitTimeoutError.md +0 -349
- package/docs/classes/ManagedDatabaseConnection.md +0 -403
- package/docs/classes/Middleware.md +0 -72
- package/docs/classes/MissingConfigError.md +0 -341
- package/docs/classes/MissingParameterError.md +0 -341
- package/docs/classes/MySQLConnection.md +0 -569
- package/docs/classes/MySQLDatabase.md +0 -314
- package/docs/classes/NotImplementedError.md +0 -341
- package/docs/classes/Point.md +0 -102
- package/docs/classes/Polygon.md +0 -101
- package/docs/classes/Query.md +0 -227
- package/docs/classes/RawError.md +0 -351
- package/docs/classes/RawQuery.md +0 -224
- package/docs/classes/Request.md +0 -321
- package/docs/classes/Response.md +0 -242
- package/docs/classes/ResponseData.md +0 -144
- package/docs/classes/ServiceProvider.md +0 -296
- package/docs/classes/ServiceResponse.md +0 -89
- package/docs/classes/SetSessionVariableQuery.md +0 -207
- package/docs/classes/StormError.md +0 -343
- package/docs/classes/TemporaryTableQuery.md +0 -213
- package/docs/classes/Token.md +0 -43
- package/docs/classes/TokenManager.md +0 -105
- package/docs/classes/Transaction.md +0 -161
- package/docs/classes/UnauthorizedAccessError.md +0 -341
- package/docs/enums/ErrorCode.md +0 -107
- package/docs/enums/ExitCode.md +0 -30
- package/docs/enums/HTTPMethod.md +0 -52
- package/docs/enums/IsolationLevel.md +0 -52
- package/docs/enums/JWTError.md +0 -30
- package/docs/enums/StatusCode.md +0 -536
- package/docs/interfaces/IAdditionalErrorDetails.md +0 -7
- package/docs/interfaces/IAuthTokenData.md +0 -41
- package/docs/interfaces/IConfig.md +0 -112
- package/docs/interfaces/IDatabaseConfig.md +0 -80
- package/docs/interfaces/IDatabaseConnection.md +0 -262
- package/docs/interfaces/IErrorResponse.md +0 -63
- package/docs/interfaces/IFormData.md +0 -30
- package/docs/interfaces/IHandler.md +0 -31
- package/docs/interfaces/IInsertQueryResult.md +0 -41
- package/docs/interfaces/IJWTVerifyOptions.md +0 -19
- package/docs/interfaces/IParameterMap.md +0 -7
- package/docs/interfaces/IQueryable.md +0 -119
- package/docs/interfaces/IRequestResponse.md +0 -37
- package/docs/interfaces/IServiceHeaders.md +0 -7
- package/docs/interfaces/ISetSessionVariableQueryInput.md +0 -30
- package/docs/interfaces/ITemporaryTableQueryInput.md +0 -30
- package/docs/interfaces/IUpdateQueryResult.md +0 -30
- package/docs/interfaces/formidable.EmitData.md +0 -54
- package/docs/interfaces/formidable.EventData.md +0 -87
- package/docs/interfaces/formidable.Fields.md +0 -9
- package/docs/interfaces/formidable.File.md +0 -131
- package/docs/interfaces/formidable.FileJSON.md +0 -151
- package/docs/interfaces/formidable.Files.md +0 -9
- package/docs/interfaces/formidable.Options.md +0 -225
- package/docs/interfaces/formidable.Part.md +0 -793
- package/docs/modules/formidable.md +0 -122
|
@@ -1,793 +0,0 @@
|
|
|
1
|
-
[@breautek/storm](../README.md) / [formidable](../modules/formidable.md) / Part
|
|
2
|
-
|
|
3
|
-
# Interface: Part
|
|
4
|
-
|
|
5
|
-
[formidable](../modules/formidable.md).Part
|
|
6
|
-
|
|
7
|
-
## Hierarchy
|
|
8
|
-
|
|
9
|
-
- `Stream`
|
|
10
|
-
|
|
11
|
-
↳ **`Part`**
|
|
12
|
-
|
|
13
|
-
## Table of contents
|
|
14
|
-
|
|
15
|
-
### Properties
|
|
16
|
-
|
|
17
|
-
- [filename](formidable.Part.md#filename)
|
|
18
|
-
- [headers](formidable.Part.md#headers)
|
|
19
|
-
- [mime](formidable.Part.md#mime)
|
|
20
|
-
- [name](formidable.Part.md#name)
|
|
21
|
-
|
|
22
|
-
### Methods
|
|
23
|
-
|
|
24
|
-
- [addListener](formidable.Part.md#addlistener)
|
|
25
|
-
- [emit](formidable.Part.md#emit)
|
|
26
|
-
- [eventNames](formidable.Part.md#eventnames)
|
|
27
|
-
- [getMaxListeners](formidable.Part.md#getmaxlisteners)
|
|
28
|
-
- [listenerCount](formidable.Part.md#listenercount)
|
|
29
|
-
- [listeners](formidable.Part.md#listeners)
|
|
30
|
-
- [off](formidable.Part.md#off)
|
|
31
|
-
- [on](formidable.Part.md#on)
|
|
32
|
-
- [once](formidable.Part.md#once)
|
|
33
|
-
- [pipe](formidable.Part.md#pipe)
|
|
34
|
-
- [prependListener](formidable.Part.md#prependlistener)
|
|
35
|
-
- [prependOnceListener](formidable.Part.md#prependoncelistener)
|
|
36
|
-
- [rawListeners](formidable.Part.md#rawlisteners)
|
|
37
|
-
- [removeAllListeners](formidable.Part.md#removealllisteners)
|
|
38
|
-
- [removeListener](formidable.Part.md#removelistener)
|
|
39
|
-
- [setMaxListeners](formidable.Part.md#setmaxlisteners)
|
|
40
|
-
|
|
41
|
-
## Properties
|
|
42
|
-
|
|
43
|
-
### filename
|
|
44
|
-
|
|
45
|
-
• `Optional` **filename**: `string`
|
|
46
|
-
|
|
47
|
-
#### Defined in
|
|
48
|
-
|
|
49
|
-
node_modules/@types/formidable/index.d.ts:184
|
|
50
|
-
|
|
51
|
-
___
|
|
52
|
-
|
|
53
|
-
### headers
|
|
54
|
-
|
|
55
|
-
• **headers**: `Record`<`string`, `string`\>
|
|
56
|
-
|
|
57
|
-
#### Defined in
|
|
58
|
-
|
|
59
|
-
node_modules/@types/formidable/index.d.ts:185
|
|
60
|
-
|
|
61
|
-
___
|
|
62
|
-
|
|
63
|
-
### mime
|
|
64
|
-
|
|
65
|
-
• `Optional` **mime**: `string`
|
|
66
|
-
|
|
67
|
-
#### Defined in
|
|
68
|
-
|
|
69
|
-
node_modules/@types/formidable/index.d.ts:186
|
|
70
|
-
|
|
71
|
-
___
|
|
72
|
-
|
|
73
|
-
### name
|
|
74
|
-
|
|
75
|
-
• **name**: `string`
|
|
76
|
-
|
|
77
|
-
#### Defined in
|
|
78
|
-
|
|
79
|
-
node_modules/@types/formidable/index.d.ts:187
|
|
80
|
-
|
|
81
|
-
## Methods
|
|
82
|
-
|
|
83
|
-
### addListener
|
|
84
|
-
|
|
85
|
-
▸ **addListener**(`eventName`, `listener`): [`Part`](formidable.Part.md)
|
|
86
|
-
|
|
87
|
-
Alias for `emitter.on(eventName, listener)`.
|
|
88
|
-
|
|
89
|
-
**`Since`**
|
|
90
|
-
|
|
91
|
-
v0.1.26
|
|
92
|
-
|
|
93
|
-
#### Parameters
|
|
94
|
-
|
|
95
|
-
| Name | Type |
|
|
96
|
-
| :------ | :------ |
|
|
97
|
-
| `eventName` | `string` \| `symbol` |
|
|
98
|
-
| `listener` | (...`args`: `any`[]) => `void` |
|
|
99
|
-
|
|
100
|
-
#### Returns
|
|
101
|
-
|
|
102
|
-
[`Part`](formidable.Part.md)
|
|
103
|
-
|
|
104
|
-
#### Inherited from
|
|
105
|
-
|
|
106
|
-
Stream.addListener
|
|
107
|
-
|
|
108
|
-
#### Defined in
|
|
109
|
-
|
|
110
|
-
node_modules/@types/node/events.d.ts:354
|
|
111
|
-
|
|
112
|
-
___
|
|
113
|
-
|
|
114
|
-
### emit
|
|
115
|
-
|
|
116
|
-
▸ **emit**(`eventName`, `...args`): `boolean`
|
|
117
|
-
|
|
118
|
-
Synchronously calls each of the listeners registered for the event named`eventName`, in the order they were registered, passing the supplied arguments
|
|
119
|
-
to each.
|
|
120
|
-
|
|
121
|
-
Returns `true` if the event had listeners, `false` otherwise.
|
|
122
|
-
|
|
123
|
-
```js
|
|
124
|
-
const EventEmitter = require('events');
|
|
125
|
-
const myEmitter = new EventEmitter();
|
|
126
|
-
|
|
127
|
-
// First listener
|
|
128
|
-
myEmitter.on('event', function firstListener() {
|
|
129
|
-
console.log('Helloooo! first listener');
|
|
130
|
-
});
|
|
131
|
-
// Second listener
|
|
132
|
-
myEmitter.on('event', function secondListener(arg1, arg2) {
|
|
133
|
-
console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
|
|
134
|
-
});
|
|
135
|
-
// Third listener
|
|
136
|
-
myEmitter.on('event', function thirdListener(...args) {
|
|
137
|
-
const parameters = args.join(', ');
|
|
138
|
-
console.log(`event with parameters ${parameters} in third listener`);
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
console.log(myEmitter.listeners('event'));
|
|
142
|
-
|
|
143
|
-
myEmitter.emit('event', 1, 2, 3, 4, 5);
|
|
144
|
-
|
|
145
|
-
// Prints:
|
|
146
|
-
// [
|
|
147
|
-
// [Function: firstListener],
|
|
148
|
-
// [Function: secondListener],
|
|
149
|
-
// [Function: thirdListener]
|
|
150
|
-
// ]
|
|
151
|
-
// Helloooo! first listener
|
|
152
|
-
// event with parameters 1, 2 in second listener
|
|
153
|
-
// event with parameters 1, 2, 3, 4, 5 in third listener
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
**`Since`**
|
|
157
|
-
|
|
158
|
-
v0.1.26
|
|
159
|
-
|
|
160
|
-
#### Parameters
|
|
161
|
-
|
|
162
|
-
| Name | Type |
|
|
163
|
-
| :------ | :------ |
|
|
164
|
-
| `eventName` | `string` \| `symbol` |
|
|
165
|
-
| `...args` | `any`[] |
|
|
166
|
-
|
|
167
|
-
#### Returns
|
|
168
|
-
|
|
169
|
-
`boolean`
|
|
170
|
-
|
|
171
|
-
#### Inherited from
|
|
172
|
-
|
|
173
|
-
Stream.emit
|
|
174
|
-
|
|
175
|
-
#### Defined in
|
|
176
|
-
|
|
177
|
-
node_modules/@types/node/events.d.ts:610
|
|
178
|
-
|
|
179
|
-
___
|
|
180
|
-
|
|
181
|
-
### eventNames
|
|
182
|
-
|
|
183
|
-
▸ **eventNames**(): (`string` \| `symbol`)[]
|
|
184
|
-
|
|
185
|
-
Returns an array listing the events for which the emitter has registered
|
|
186
|
-
listeners. The values in the array are strings or `Symbol`s.
|
|
187
|
-
|
|
188
|
-
```js
|
|
189
|
-
const EventEmitter = require('events');
|
|
190
|
-
const myEE = new EventEmitter();
|
|
191
|
-
myEE.on('foo', () => {});
|
|
192
|
-
myEE.on('bar', () => {});
|
|
193
|
-
|
|
194
|
-
const sym = Symbol('symbol');
|
|
195
|
-
myEE.on(sym, () => {});
|
|
196
|
-
|
|
197
|
-
console.log(myEE.eventNames());
|
|
198
|
-
// Prints: [ 'foo', 'bar', Symbol(symbol) ]
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
**`Since`**
|
|
202
|
-
|
|
203
|
-
v6.0.0
|
|
204
|
-
|
|
205
|
-
#### Returns
|
|
206
|
-
|
|
207
|
-
(`string` \| `symbol`)[]
|
|
208
|
-
|
|
209
|
-
#### Inherited from
|
|
210
|
-
|
|
211
|
-
Stream.eventNames
|
|
212
|
-
|
|
213
|
-
#### Defined in
|
|
214
|
-
|
|
215
|
-
node_modules/@types/node/events.d.ts:669
|
|
216
|
-
|
|
217
|
-
___
|
|
218
|
-
|
|
219
|
-
### getMaxListeners
|
|
220
|
-
|
|
221
|
-
▸ **getMaxListeners**(): `number`
|
|
222
|
-
|
|
223
|
-
Returns the current max listener value for the `EventEmitter` which is either
|
|
224
|
-
set by `emitter.setMaxListeners(n)` or defaults to defaultMaxListeners.
|
|
225
|
-
|
|
226
|
-
**`Since`**
|
|
227
|
-
|
|
228
|
-
v1.0.0
|
|
229
|
-
|
|
230
|
-
#### Returns
|
|
231
|
-
|
|
232
|
-
`number`
|
|
233
|
-
|
|
234
|
-
#### Inherited from
|
|
235
|
-
|
|
236
|
-
Stream.getMaxListeners
|
|
237
|
-
|
|
238
|
-
#### Defined in
|
|
239
|
-
|
|
240
|
-
node_modules/@types/node/events.d.ts:526
|
|
241
|
-
|
|
242
|
-
___
|
|
243
|
-
|
|
244
|
-
### listenerCount
|
|
245
|
-
|
|
246
|
-
▸ **listenerCount**(`eventName`): `number`
|
|
247
|
-
|
|
248
|
-
Returns the number of listeners listening to the event named `eventName`.
|
|
249
|
-
|
|
250
|
-
**`Since`**
|
|
251
|
-
|
|
252
|
-
v3.2.0
|
|
253
|
-
|
|
254
|
-
#### Parameters
|
|
255
|
-
|
|
256
|
-
| Name | Type | Description |
|
|
257
|
-
| :------ | :------ | :------ |
|
|
258
|
-
| `eventName` | `string` \| `symbol` | The name of the event being listened for |
|
|
259
|
-
|
|
260
|
-
#### Returns
|
|
261
|
-
|
|
262
|
-
`number`
|
|
263
|
-
|
|
264
|
-
#### Inherited from
|
|
265
|
-
|
|
266
|
-
Stream.listenerCount
|
|
267
|
-
|
|
268
|
-
#### Defined in
|
|
269
|
-
|
|
270
|
-
node_modules/@types/node/events.d.ts:616
|
|
271
|
-
|
|
272
|
-
___
|
|
273
|
-
|
|
274
|
-
### listeners
|
|
275
|
-
|
|
276
|
-
▸ **listeners**(`eventName`): `Function`[]
|
|
277
|
-
|
|
278
|
-
Returns a copy of the array of listeners for the event named `eventName`.
|
|
279
|
-
|
|
280
|
-
```js
|
|
281
|
-
server.on('connection', (stream) => {
|
|
282
|
-
console.log('someone connected!');
|
|
283
|
-
});
|
|
284
|
-
console.log(util.inspect(server.listeners('connection')));
|
|
285
|
-
// Prints: [ [Function] ]
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
**`Since`**
|
|
289
|
-
|
|
290
|
-
v0.1.26
|
|
291
|
-
|
|
292
|
-
#### Parameters
|
|
293
|
-
|
|
294
|
-
| Name | Type |
|
|
295
|
-
| :------ | :------ |
|
|
296
|
-
| `eventName` | `string` \| `symbol` |
|
|
297
|
-
|
|
298
|
-
#### Returns
|
|
299
|
-
|
|
300
|
-
`Function`[]
|
|
301
|
-
|
|
302
|
-
#### Inherited from
|
|
303
|
-
|
|
304
|
-
Stream.listeners
|
|
305
|
-
|
|
306
|
-
#### Defined in
|
|
307
|
-
|
|
308
|
-
node_modules/@types/node/events.d.ts:539
|
|
309
|
-
|
|
310
|
-
___
|
|
311
|
-
|
|
312
|
-
### off
|
|
313
|
-
|
|
314
|
-
▸ **off**(`eventName`, `listener`): [`Part`](formidable.Part.md)
|
|
315
|
-
|
|
316
|
-
Alias for `emitter.removeListener()`.
|
|
317
|
-
|
|
318
|
-
**`Since`**
|
|
319
|
-
|
|
320
|
-
v10.0.0
|
|
321
|
-
|
|
322
|
-
#### Parameters
|
|
323
|
-
|
|
324
|
-
| Name | Type |
|
|
325
|
-
| :------ | :------ |
|
|
326
|
-
| `eventName` | `string` \| `symbol` |
|
|
327
|
-
| `listener` | (...`args`: `any`[]) => `void` |
|
|
328
|
-
|
|
329
|
-
#### Returns
|
|
330
|
-
|
|
331
|
-
[`Part`](formidable.Part.md)
|
|
332
|
-
|
|
333
|
-
#### Inherited from
|
|
334
|
-
|
|
335
|
-
Stream.off
|
|
336
|
-
|
|
337
|
-
#### Defined in
|
|
338
|
-
|
|
339
|
-
node_modules/@types/node/events.d.ts:499
|
|
340
|
-
|
|
341
|
-
___
|
|
342
|
-
|
|
343
|
-
### on
|
|
344
|
-
|
|
345
|
-
▸ **on**(`eventName`, `listener`): [`Part`](formidable.Part.md)
|
|
346
|
-
|
|
347
|
-
Adds the `listener` function to the end of the listeners array for the
|
|
348
|
-
event named `eventName`. No checks are made to see if the `listener` has
|
|
349
|
-
already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple
|
|
350
|
-
times.
|
|
351
|
-
|
|
352
|
-
```js
|
|
353
|
-
server.on('connection', (stream) => {
|
|
354
|
-
console.log('someone connected!');
|
|
355
|
-
});
|
|
356
|
-
```
|
|
357
|
-
|
|
358
|
-
Returns a reference to the `EventEmitter`, so that calls can be chained.
|
|
359
|
-
|
|
360
|
-
By default, event listeners are invoked in the order they are added. The`emitter.prependListener()` method can be used as an alternative to add the
|
|
361
|
-
event listener to the beginning of the listeners array.
|
|
362
|
-
|
|
363
|
-
```js
|
|
364
|
-
const myEE = new EventEmitter();
|
|
365
|
-
myEE.on('foo', () => console.log('a'));
|
|
366
|
-
myEE.prependListener('foo', () => console.log('b'));
|
|
367
|
-
myEE.emit('foo');
|
|
368
|
-
// Prints:
|
|
369
|
-
// b
|
|
370
|
-
// a
|
|
371
|
-
```
|
|
372
|
-
|
|
373
|
-
**`Since`**
|
|
374
|
-
|
|
375
|
-
v0.1.101
|
|
376
|
-
|
|
377
|
-
#### Parameters
|
|
378
|
-
|
|
379
|
-
| Name | Type | Description |
|
|
380
|
-
| :------ | :------ | :------ |
|
|
381
|
-
| `eventName` | `string` \| `symbol` | The name of the event. |
|
|
382
|
-
| `listener` | (...`args`: `any`[]) => `void` | The callback function |
|
|
383
|
-
|
|
384
|
-
#### Returns
|
|
385
|
-
|
|
386
|
-
[`Part`](formidable.Part.md)
|
|
387
|
-
|
|
388
|
-
#### Inherited from
|
|
389
|
-
|
|
390
|
-
Stream.on
|
|
391
|
-
|
|
392
|
-
#### Defined in
|
|
393
|
-
|
|
394
|
-
node_modules/@types/node/events.d.ts:385
|
|
395
|
-
|
|
396
|
-
___
|
|
397
|
-
|
|
398
|
-
### once
|
|
399
|
-
|
|
400
|
-
▸ **once**(`eventName`, `listener`): [`Part`](formidable.Part.md)
|
|
401
|
-
|
|
402
|
-
Adds a **one-time**`listener` function for the event named `eventName`. The
|
|
403
|
-
next time `eventName` is triggered, this listener is removed and then invoked.
|
|
404
|
-
|
|
405
|
-
```js
|
|
406
|
-
server.once('connection', (stream) => {
|
|
407
|
-
console.log('Ah, we have our first user!');
|
|
408
|
-
});
|
|
409
|
-
```
|
|
410
|
-
|
|
411
|
-
Returns a reference to the `EventEmitter`, so that calls can be chained.
|
|
412
|
-
|
|
413
|
-
By default, event listeners are invoked in the order they are added. The`emitter.prependOnceListener()` method can be used as an alternative to add the
|
|
414
|
-
event listener to the beginning of the listeners array.
|
|
415
|
-
|
|
416
|
-
```js
|
|
417
|
-
const myEE = new EventEmitter();
|
|
418
|
-
myEE.once('foo', () => console.log('a'));
|
|
419
|
-
myEE.prependOnceListener('foo', () => console.log('b'));
|
|
420
|
-
myEE.emit('foo');
|
|
421
|
-
// Prints:
|
|
422
|
-
// b
|
|
423
|
-
// a
|
|
424
|
-
```
|
|
425
|
-
|
|
426
|
-
**`Since`**
|
|
427
|
-
|
|
428
|
-
v0.3.0
|
|
429
|
-
|
|
430
|
-
#### Parameters
|
|
431
|
-
|
|
432
|
-
| Name | Type | Description |
|
|
433
|
-
| :------ | :------ | :------ |
|
|
434
|
-
| `eventName` | `string` \| `symbol` | The name of the event. |
|
|
435
|
-
| `listener` | (...`args`: `any`[]) => `void` | The callback function |
|
|
436
|
-
|
|
437
|
-
#### Returns
|
|
438
|
-
|
|
439
|
-
[`Part`](formidable.Part.md)
|
|
440
|
-
|
|
441
|
-
#### Inherited from
|
|
442
|
-
|
|
443
|
-
Stream.once
|
|
444
|
-
|
|
445
|
-
#### Defined in
|
|
446
|
-
|
|
447
|
-
node_modules/@types/node/events.d.ts:414
|
|
448
|
-
|
|
449
|
-
___
|
|
450
|
-
|
|
451
|
-
### pipe
|
|
452
|
-
|
|
453
|
-
▸ **pipe**<`T`\>(`destination`, `options?`): `T`
|
|
454
|
-
|
|
455
|
-
#### Type parameters
|
|
456
|
-
|
|
457
|
-
| Name | Type |
|
|
458
|
-
| :------ | :------ |
|
|
459
|
-
| `T` | extends `WritableStream`<`T`\> |
|
|
460
|
-
|
|
461
|
-
#### Parameters
|
|
462
|
-
|
|
463
|
-
| Name | Type |
|
|
464
|
-
| :------ | :------ |
|
|
465
|
-
| `destination` | `T` |
|
|
466
|
-
| `options?` | `Object` |
|
|
467
|
-
| `options.end?` | `boolean` |
|
|
468
|
-
|
|
469
|
-
#### Returns
|
|
470
|
-
|
|
471
|
-
`T`
|
|
472
|
-
|
|
473
|
-
#### Inherited from
|
|
474
|
-
|
|
475
|
-
Stream.pipe
|
|
476
|
-
|
|
477
|
-
#### Defined in
|
|
478
|
-
|
|
479
|
-
node_modules/@types/node/stream.d.ts:26
|
|
480
|
-
|
|
481
|
-
___
|
|
482
|
-
|
|
483
|
-
### prependListener
|
|
484
|
-
|
|
485
|
-
▸ **prependListener**(`eventName`, `listener`): [`Part`](formidable.Part.md)
|
|
486
|
-
|
|
487
|
-
Adds the `listener` function to the _beginning_ of the listeners array for the
|
|
488
|
-
event named `eventName`. No checks are made to see if the `listener` has
|
|
489
|
-
already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple
|
|
490
|
-
times.
|
|
491
|
-
|
|
492
|
-
```js
|
|
493
|
-
server.prependListener('connection', (stream) => {
|
|
494
|
-
console.log('someone connected!');
|
|
495
|
-
});
|
|
496
|
-
```
|
|
497
|
-
|
|
498
|
-
Returns a reference to the `EventEmitter`, so that calls can be chained.
|
|
499
|
-
|
|
500
|
-
**`Since`**
|
|
501
|
-
|
|
502
|
-
v6.0.0
|
|
503
|
-
|
|
504
|
-
#### Parameters
|
|
505
|
-
|
|
506
|
-
| Name | Type | Description |
|
|
507
|
-
| :------ | :------ | :------ |
|
|
508
|
-
| `eventName` | `string` \| `symbol` | The name of the event. |
|
|
509
|
-
| `listener` | (...`args`: `any`[]) => `void` | The callback function |
|
|
510
|
-
|
|
511
|
-
#### Returns
|
|
512
|
-
|
|
513
|
-
[`Part`](formidable.Part.md)
|
|
514
|
-
|
|
515
|
-
#### Inherited from
|
|
516
|
-
|
|
517
|
-
Stream.prependListener
|
|
518
|
-
|
|
519
|
-
#### Defined in
|
|
520
|
-
|
|
521
|
-
node_modules/@types/node/events.d.ts:634
|
|
522
|
-
|
|
523
|
-
___
|
|
524
|
-
|
|
525
|
-
### prependOnceListener
|
|
526
|
-
|
|
527
|
-
▸ **prependOnceListener**(`eventName`, `listener`): [`Part`](formidable.Part.md)
|
|
528
|
-
|
|
529
|
-
Adds a **one-time**`listener` function for the event named `eventName` to the _beginning_ of the listeners array. The next time `eventName` is triggered, this
|
|
530
|
-
listener is removed, and then invoked.
|
|
531
|
-
|
|
532
|
-
```js
|
|
533
|
-
server.prependOnceListener('connection', (stream) => {
|
|
534
|
-
console.log('Ah, we have our first user!');
|
|
535
|
-
});
|
|
536
|
-
```
|
|
537
|
-
|
|
538
|
-
Returns a reference to the `EventEmitter`, so that calls can be chained.
|
|
539
|
-
|
|
540
|
-
**`Since`**
|
|
541
|
-
|
|
542
|
-
v6.0.0
|
|
543
|
-
|
|
544
|
-
#### Parameters
|
|
545
|
-
|
|
546
|
-
| Name | Type | Description |
|
|
547
|
-
| :------ | :------ | :------ |
|
|
548
|
-
| `eventName` | `string` \| `symbol` | The name of the event. |
|
|
549
|
-
| `listener` | (...`args`: `any`[]) => `void` | The callback function |
|
|
550
|
-
|
|
551
|
-
#### Returns
|
|
552
|
-
|
|
553
|
-
[`Part`](formidable.Part.md)
|
|
554
|
-
|
|
555
|
-
#### Inherited from
|
|
556
|
-
|
|
557
|
-
Stream.prependOnceListener
|
|
558
|
-
|
|
559
|
-
#### Defined in
|
|
560
|
-
|
|
561
|
-
node_modules/@types/node/events.d.ts:650
|
|
562
|
-
|
|
563
|
-
___
|
|
564
|
-
|
|
565
|
-
### rawListeners
|
|
566
|
-
|
|
567
|
-
▸ **rawListeners**(`eventName`): `Function`[]
|
|
568
|
-
|
|
569
|
-
Returns a copy of the array of listeners for the event named `eventName`,
|
|
570
|
-
including any wrappers (such as those created by `.once()`).
|
|
571
|
-
|
|
572
|
-
```js
|
|
573
|
-
const emitter = new EventEmitter();
|
|
574
|
-
emitter.once('log', () => console.log('log once'));
|
|
575
|
-
|
|
576
|
-
// Returns a new Array with a function `onceWrapper` which has a property
|
|
577
|
-
// `listener` which contains the original listener bound above
|
|
578
|
-
const listeners = emitter.rawListeners('log');
|
|
579
|
-
const logFnWrapper = listeners[0];
|
|
580
|
-
|
|
581
|
-
// Logs "log once" to the console and does not unbind the `once` event
|
|
582
|
-
logFnWrapper.listener();
|
|
583
|
-
|
|
584
|
-
// Logs "log once" to the console and removes the listener
|
|
585
|
-
logFnWrapper();
|
|
586
|
-
|
|
587
|
-
emitter.on('log', () => console.log('log persistently'));
|
|
588
|
-
// Will return a new Array with a single function bound by `.on()` above
|
|
589
|
-
const newListeners = emitter.rawListeners('log');
|
|
590
|
-
|
|
591
|
-
// Logs "log persistently" twice
|
|
592
|
-
newListeners[0]();
|
|
593
|
-
emitter.emit('log');
|
|
594
|
-
```
|
|
595
|
-
|
|
596
|
-
**`Since`**
|
|
597
|
-
|
|
598
|
-
v9.4.0
|
|
599
|
-
|
|
600
|
-
#### Parameters
|
|
601
|
-
|
|
602
|
-
| Name | Type |
|
|
603
|
-
| :------ | :------ |
|
|
604
|
-
| `eventName` | `string` \| `symbol` |
|
|
605
|
-
|
|
606
|
-
#### Returns
|
|
607
|
-
|
|
608
|
-
`Function`[]
|
|
609
|
-
|
|
610
|
-
#### Inherited from
|
|
611
|
-
|
|
612
|
-
Stream.rawListeners
|
|
613
|
-
|
|
614
|
-
#### Defined in
|
|
615
|
-
|
|
616
|
-
node_modules/@types/node/events.d.ts:569
|
|
617
|
-
|
|
618
|
-
___
|
|
619
|
-
|
|
620
|
-
### removeAllListeners
|
|
621
|
-
|
|
622
|
-
▸ **removeAllListeners**(`event?`): [`Part`](formidable.Part.md)
|
|
623
|
-
|
|
624
|
-
Removes all listeners, or those of the specified `eventName`.
|
|
625
|
-
|
|
626
|
-
It is bad practice to remove listeners added elsewhere in the code,
|
|
627
|
-
particularly when the `EventEmitter` instance was created by some other
|
|
628
|
-
component or module (e.g. sockets or file streams).
|
|
629
|
-
|
|
630
|
-
Returns a reference to the `EventEmitter`, so that calls can be chained.
|
|
631
|
-
|
|
632
|
-
**`Since`**
|
|
633
|
-
|
|
634
|
-
v0.1.26
|
|
635
|
-
|
|
636
|
-
#### Parameters
|
|
637
|
-
|
|
638
|
-
| Name | Type |
|
|
639
|
-
| :------ | :------ |
|
|
640
|
-
| `event?` | `string` \| `symbol` |
|
|
641
|
-
|
|
642
|
-
#### Returns
|
|
643
|
-
|
|
644
|
-
[`Part`](formidable.Part.md)
|
|
645
|
-
|
|
646
|
-
#### Inherited from
|
|
647
|
-
|
|
648
|
-
Stream.removeAllListeners
|
|
649
|
-
|
|
650
|
-
#### Defined in
|
|
651
|
-
|
|
652
|
-
node_modules/@types/node/events.d.ts:510
|
|
653
|
-
|
|
654
|
-
___
|
|
655
|
-
|
|
656
|
-
### removeListener
|
|
657
|
-
|
|
658
|
-
▸ **removeListener**(`eventName`, `listener`): [`Part`](formidable.Part.md)
|
|
659
|
-
|
|
660
|
-
Removes the specified `listener` from the listener array for the event named`eventName`.
|
|
661
|
-
|
|
662
|
-
```js
|
|
663
|
-
const callback = (stream) => {
|
|
664
|
-
console.log('someone connected!');
|
|
665
|
-
};
|
|
666
|
-
server.on('connection', callback);
|
|
667
|
-
// ...
|
|
668
|
-
server.removeListener('connection', callback);
|
|
669
|
-
```
|
|
670
|
-
|
|
671
|
-
`removeListener()` will remove, at most, one instance of a listener from the
|
|
672
|
-
listener array. If any single listener has been added multiple times to the
|
|
673
|
-
listener array for the specified `eventName`, then `removeListener()` must be
|
|
674
|
-
called multiple times to remove each instance.
|
|
675
|
-
|
|
676
|
-
Once an event is emitted, all listeners attached to it at the
|
|
677
|
-
time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution
|
|
678
|
-
will not remove them from`emit()` in progress. Subsequent events behave as expected.
|
|
679
|
-
|
|
680
|
-
```js
|
|
681
|
-
const myEmitter = new MyEmitter();
|
|
682
|
-
|
|
683
|
-
const callbackA = () => {
|
|
684
|
-
console.log('A');
|
|
685
|
-
myEmitter.removeListener('event', callbackB);
|
|
686
|
-
};
|
|
687
|
-
|
|
688
|
-
const callbackB = () => {
|
|
689
|
-
console.log('B');
|
|
690
|
-
};
|
|
691
|
-
|
|
692
|
-
myEmitter.on('event', callbackA);
|
|
693
|
-
|
|
694
|
-
myEmitter.on('event', callbackB);
|
|
695
|
-
|
|
696
|
-
// callbackA removes listener callbackB but it will still be called.
|
|
697
|
-
// Internal listener array at time of emit [callbackA, callbackB]
|
|
698
|
-
myEmitter.emit('event');
|
|
699
|
-
// Prints:
|
|
700
|
-
// A
|
|
701
|
-
// B
|
|
702
|
-
|
|
703
|
-
// callbackB is now removed.
|
|
704
|
-
// Internal listener array [callbackA]
|
|
705
|
-
myEmitter.emit('event');
|
|
706
|
-
// Prints:
|
|
707
|
-
// A
|
|
708
|
-
```
|
|
709
|
-
|
|
710
|
-
Because listeners are managed using an internal array, calling this will
|
|
711
|
-
change the position indices of any listener registered _after_ the listener
|
|
712
|
-
being removed. This will not impact the order in which listeners are called,
|
|
713
|
-
but it means that any copies of the listener array as returned by
|
|
714
|
-
the `emitter.listeners()` method will need to be recreated.
|
|
715
|
-
|
|
716
|
-
When a single function has been added as a handler multiple times for a single
|
|
717
|
-
event (as in the example below), `removeListener()` will remove the most
|
|
718
|
-
recently added instance. In the example the `once('ping')`listener is removed:
|
|
719
|
-
|
|
720
|
-
```js
|
|
721
|
-
const ee = new EventEmitter();
|
|
722
|
-
|
|
723
|
-
function pong() {
|
|
724
|
-
console.log('pong');
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
ee.on('ping', pong);
|
|
728
|
-
ee.once('ping', pong);
|
|
729
|
-
ee.removeListener('ping', pong);
|
|
730
|
-
|
|
731
|
-
ee.emit('ping');
|
|
732
|
-
ee.emit('ping');
|
|
733
|
-
```
|
|
734
|
-
|
|
735
|
-
Returns a reference to the `EventEmitter`, so that calls can be chained.
|
|
736
|
-
|
|
737
|
-
**`Since`**
|
|
738
|
-
|
|
739
|
-
v0.1.26
|
|
740
|
-
|
|
741
|
-
#### Parameters
|
|
742
|
-
|
|
743
|
-
| Name | Type |
|
|
744
|
-
| :------ | :------ |
|
|
745
|
-
| `eventName` | `string` \| `symbol` |
|
|
746
|
-
| `listener` | (...`args`: `any`[]) => `void` |
|
|
747
|
-
|
|
748
|
-
#### Returns
|
|
749
|
-
|
|
750
|
-
[`Part`](formidable.Part.md)
|
|
751
|
-
|
|
752
|
-
#### Inherited from
|
|
753
|
-
|
|
754
|
-
Stream.removeListener
|
|
755
|
-
|
|
756
|
-
#### Defined in
|
|
757
|
-
|
|
758
|
-
node_modules/@types/node/events.d.ts:494
|
|
759
|
-
|
|
760
|
-
___
|
|
761
|
-
|
|
762
|
-
### setMaxListeners
|
|
763
|
-
|
|
764
|
-
▸ **setMaxListeners**(`n`): [`Part`](formidable.Part.md)
|
|
765
|
-
|
|
766
|
-
By default `EventEmitter`s will print a warning if more than `10` listeners are
|
|
767
|
-
added for a particular event. This is a useful default that helps finding
|
|
768
|
-
memory leaks. The `emitter.setMaxListeners()` method allows the limit to be
|
|
769
|
-
modified for this specific `EventEmitter` instance. The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners.
|
|
770
|
-
|
|
771
|
-
Returns a reference to the `EventEmitter`, so that calls can be chained.
|
|
772
|
-
|
|
773
|
-
**`Since`**
|
|
774
|
-
|
|
775
|
-
v0.3.5
|
|
776
|
-
|
|
777
|
-
#### Parameters
|
|
778
|
-
|
|
779
|
-
| Name | Type |
|
|
780
|
-
| :------ | :------ |
|
|
781
|
-
| `n` | `number` |
|
|
782
|
-
|
|
783
|
-
#### Returns
|
|
784
|
-
|
|
785
|
-
[`Part`](formidable.Part.md)
|
|
786
|
-
|
|
787
|
-
#### Inherited from
|
|
788
|
-
|
|
789
|
-
Stream.setMaxListeners
|
|
790
|
-
|
|
791
|
-
#### Defined in
|
|
792
|
-
|
|
793
|
-
node_modules/@types/node/events.d.ts:520
|