Package Exports
- formdata-node
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (formdata-node) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
FormData
FormData implementation for Node.js. Built over Readable stream and async generators.
Installation
You can install this package from npm:
npm install --save then-busboy
Or with yarn:
yarn add then-busboy
API
constructor FormData()
Initialize new FormData instance
Instance methods
set(name, value[, filename]) -> {void}
Set a new value for an existing key inside FormData, or add the new field if it does not already exist.
- {string} name – The name of the field whose data is contained in value
- {any} value – The field value. You can pass any JavaScript primitive type (including null and undefined), Buffer or Readable stream. Note that Arrays and Object will be converted to string by using String function.
- {string} [filename = undefined] – A filename of given field. Can be added only for Buffer and Readable .
append(name, value[, filename]) -> {void}
Appends a new value onto an existing key inside a FormData object, or adds the key if it does not already exist.
- {string} name – The name of the field whose data is contained in value
- {any} value – The field value. You can pass any JavaScript primitive type (including null and undefined), Buffer or Readable stream. Note that Arrays and Object will be converted to string by using String function.
- {string} [filename = undefined] – A filename of given field. Can be added only for Buffer and Readable .
get(name) -> {string | Buffer | stream.Readable}
Returns the first value associated with the given name. Buffer and Readable values will be returned as-is.
- {string} – A name of the value you want to retrieve.
getAll(name) -> {string[] | Buffer[] | stream.Readable[]}
Returns all the values associated with a given key from within a FormData object.
- {string} – A name of the value you want to retrieve.
has(name) -> {boolean}
Check if a field with the given name exists inside FormData.
- {string} – A name of the field you want to test for.
delete(name) -> {void}
Deletes a key and its value(s) from a FormData object.
- {string} name – The name of the key you want to delete.
keys() -> {iterator}
Returns an iterator allowing to go through the FormData keys
values() -> {iterator}
Returns an iterator allowing to go through the FormData values
entries() -> {iterator}
Returns an iterator allowing to go through the FormData key/value pairs
[Symbol.iterator]() -> {iterator}
An alias of FormData#entries
Related packages
- then-busboy – Promise-based wrapper around Busboy. Process multipart/form-data content and returns it as a single object. Will be helpful to handle your data on the server-side applications.