@faasjs/request 0.0.3-beta.3 → 0.0.3-beta.30
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/README.md +3 -3
- package/dist/index.d.ts +9 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -52,10 +52,10 @@ ___
|
|
|
52
52
|
| Name | Type | Description |
|
|
53
53
|
| :------ | :------ | :------ |
|
|
54
54
|
| `agent?` | `boolean` | - |
|
|
55
|
-
| `auth?` | `string` | The authentication credentials to use for the request.
|
|
55
|
+
| `auth?` | `string` | The authentication credentials to use for the request. Format: `username:password` |
|
|
56
56
|
| `body?` | { `[key: string]`: `any`; } \| `string` | - |
|
|
57
|
-
| `downloadStream?` | `NodeJS.WritableStream` | Create a write stream to download a file. |
|
|
58
|
-
| `file?` | `string` | Path of uploading a file to the server. |
|
|
57
|
+
| `downloadStream?` | `NodeJS.WritableStream` | Create a write stream to download a file. ```ts const stream = createWriteStream('filepath') await request('https://example.com', { downloadStream: stream }) ``` |
|
|
58
|
+
| `file?` | `string` | Path of uploading a file to the server. ```ts await request('https://example.com', { file: 'filepath' }) ``` |
|
|
59
59
|
| `headers?` | `http.OutgoingHttpHeaders` | - |
|
|
60
60
|
| `logger?` | `Logger` | - |
|
|
61
61
|
| `method?` | `string` | The HTTP method to use when making the request. Defaults to GET. |
|
package/dist/index.d.ts
CHANGED
|
@@ -39,10 +39,19 @@ type RequestOptions = {
|
|
|
39
39
|
auth?: string;
|
|
40
40
|
/**
|
|
41
41
|
* Path of uploading a file to the server.
|
|
42
|
+
*
|
|
43
|
+
* ```ts
|
|
44
|
+
* await request('https://example.com', { file: 'filepath' })
|
|
45
|
+
* ```
|
|
42
46
|
*/
|
|
43
47
|
file?: string;
|
|
44
48
|
/**
|
|
45
49
|
* Create a write stream to download a file.
|
|
50
|
+
*
|
|
51
|
+
* ```ts
|
|
52
|
+
* const stream = createWriteStream('filepath')
|
|
53
|
+
* await request('https://example.com', { downloadStream: stream })
|
|
54
|
+
* ```
|
|
46
55
|
*/
|
|
47
56
|
downloadStream?: NodeJS.WritableStream;
|
|
48
57
|
pfx?: Buffer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faasjs/request",
|
|
3
|
-
"version": "0.0.3-beta.
|
|
3
|
+
"version": "0.0.3-beta.30",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@faasjs/logger": "^0.0.3-beta.
|
|
25
|
+
"@faasjs/logger": "^0.0.3-beta.30"
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|
|
28
28
|
"npm": ">=8.0.0",
|