Comparing version 2.5.0 to 2.5.1
@@ -12,3 +12,12 @@ // Definitions by: Carlos Ballesteros Velasco <https://github.com/soywiz> | ||
interface Options { | ||
writable?: boolean; | ||
readable?: boolean; | ||
dataSize?: number; | ||
maxDataSize?: number; | ||
pauseStreams?: boolean; | ||
} | ||
declare class FormData extends stream.Readable { | ||
constructor(options?: Options); | ||
append(key: string, value: any, options?: FormData.AppendOptions | string): void; | ||
@@ -18,7 +27,7 @@ getHeaders(): FormData.Headers; | ||
params: string | FormData.SubmitOptions, | ||
callback?: (error: Error | undefined, response: http.IncomingMessage) => void | ||
callback?: (error: Error | null, response: http.IncomingMessage) => void | ||
): http.ClientRequest; | ||
getBuffer(): Buffer; | ||
getBoundary(): string; | ||
getLength(callback: (err: Error | undefined, length: number) => void): void; | ||
getLength(callback: (err: Error | null, length: number) => void): void; | ||
getLengthSync(): number; | ||
@@ -25,0 +34,0 @@ hasKnownLength(): boolean; |
@@ -5,3 +5,3 @@ { | ||
"description": "A library to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.", | ||
"version": "2.5.0", | ||
"version": "2.5.1", | ||
"repository": { | ||
@@ -64,3 +64,3 @@ "type": "git", | ||
"request": "^2.88.0", | ||
"rimraf": "^2.5.4", | ||
"rimraf": "^2.7.1", | ||
"tape": "^4.6.2", | ||
@@ -67,0 +67,0 @@ "typescript": "^3.5.2" |
@@ -9,7 +9,7 @@ # Form-Data [![NPM Module](https://img.shields.io/npm/v/form-data.svg)](https://www.npmjs.com/package/form-data) [![Join the chat at https://gitter.im/form-data/form-data](http://form-data.github.io/images/gitterbadge.svg)](https://gitter.im/form-data/form-data) | ||
[![Linux Build](https://img.shields.io/travis/form-data/form-data/v2.5.0.svg?label=linux:4.x-12.x)](https://travis-ci.org/form-data/form-data) | ||
[![MacOS Build](https://img.shields.io/travis/form-data/form-data/v2.5.0.svg?label=macos:4.x-12.x)](https://travis-ci.org/form-data/form-data) | ||
[![Windows Build](https://img.shields.io/travis/form-data/form-data/v2.5.0.svg?label=windows:4.x-12.x)](https://travis-ci.org/form-data/form-data) | ||
[![Linux Build](https://img.shields.io/travis/form-data/form-data/v2.5.1.svg?label=linux:4.x-12.x)](https://travis-ci.org/form-data/form-data) | ||
[![MacOS Build](https://img.shields.io/travis/form-data/form-data/v2.5.1.svg?label=macos:4.x-12.x)](https://travis-ci.org/form-data/form-data) | ||
[![Windows Build](https://img.shields.io/travis/form-data/form-data/v2.5.1.svg?label=windows:4.x-12.x)](https://travis-ci.org/form-data/form-data) | ||
[![Coverage Status](https://img.shields.io/coveralls/form-data/form-data/v2.5.0.svg?label=code+coverage)](https://coveralls.io/github/form-data/form-data?branch=master) | ||
[![Coverage Status](https://img.shields.io/coveralls/form-data/form-data/v2.5.1.svg?label=code+coverage)](https://coveralls.io/github/form-data/form-data?branch=master) | ||
[![Dependency Status](https://img.shields.io/david/form-data/form-data.svg)](https://david-dm.org/form-data/form-data) | ||
@@ -233,7 +233,6 @@ | ||
Return the full formdata request package, as a Buffer. You can insert this Buffer in e.g. Axios to send multipart data. | ||
```javascript | ||
var form = new FormData(); | ||
form.append( 'my_buffer', Buffer.from([0x4a,0x42,0x20,0x52,0x6f,0x63,0x6b,0x73]) ); | ||
form.append( 'my_file', fs.createReadStream('/foo/bar.jpg') ); | ||
form.append( 'my_file', fs.readFileSync('/foo/bar.jpg') ); | ||
@@ -245,2 +244,3 @@ axios.post( 'https://example.com/path/to/api', | ||
``` | ||
**Note:** Because the output is of type Buffer, you can only append types that are accepted by Buffer: *string, Buffer, ArrayBuffer, Array, or Array-like Object*. A ReadStream for example will result in an error. | ||
@@ -247,0 +247,0 @@ #### _Integer_ getLengthSync() |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41342
440