Skip to content

Releases: octet-stream/form-data

4.3.1

19 Oct 13:36

Choose a tag to compare

Update

  • Fix typings to allow File constructor to take Iterable<unknown> as fileBits argument;
  • Improvements for in-code documentation.

All changes: v4.3.0...v4.3.1

4.3.0

04 Oct 13:19

Choose a tag to compare

Update

  • Support custom FormData implementations in instanceof test via Symbol.hasInstance method;
  • Expose package.json using exports field (#46);
  • Deprecate entries argument in FormData constructor, because it is not spec-compliant.

All changes: v4.2.4...v4.3.0

4.2.4

29 Sep 15:05

Choose a tag to compare

Update

  • Improve type casting for lastModified option in File constructor;
  • Add Comparison section to readme.md;

All changes: v4.2.3...v4.2.4

4.2.3

27 Sep 17:14

Choose a tag to compare

Update

  • Minor improvements for Blob.stream() method;
  • Documentation improvements;
  • Mark package as side effect free.

All changes: v4.2.2...v4.2.3

4.2.2

21 Sep 22:47

Choose a tag to compare

Update

  • Deprecate FileOptions interface in favour of FilePropertyBag;
  • Documentation improvements;

All changes: v4.2.1...v4.2.2

4.2.1

10 Sep 17:46

Choose a tag to compare

Update

  • Update typings for FileLike interface and improve documentation.

All changes: v4.2.0...v4.2.1

4.2.0

09 Sep 23:47

Choose a tag to compare

Update

  • Replace entry point in module field in package.json, so it will now point to browser entry point. This should fix the issue with Rollup module resolution. See: #44

All changes: v4.1.0...v4.2.0

4.1.0

09 Sep 15:42

Choose a tag to compare

Add

  • Port Blob from fetch-blob@3 and replace fetch-blob@2 package with our own implementation. Note that formdata-node will switch back to use fetch-blob once we drop CommonJS. Our Blob implementation should be compatible with fetch-blob, so you can use either of them in FormData values. In terms of usage nothing is changed - you can import Blob as from formdata-node package:
import {FormData, Blob} from "formdata-node" // This will now import our own Blob implementation instead of `node-fetch@2`

const form = new FormData()

form.set("file", new Blob(["Some ", "content"]))
  • This release also introduces a new dependency: web-streams-polyfill, so the overall installation size will increase by ≈393KB.

All changes: v4.0.1...v4.1.0

4.0.1

22 Aug 18:53

Choose a tag to compare

Update

  • Improvements for File class spec-compliancy: Make sure File.name and File.lastModified properties read-only in runtime;
  • Cast name argument in File constructor to string;
  • Improve lastModified option normalization in File constructor to mimic browsers implementation behaviour: When lastModified option is NaN it is interpreted as 0 in browsers;
  • Improve filename argument normalization for FormData.set() and FormData.append() methods.

All changes: v4.0.0...v4.0.1

4.0.0

17 Aug 15:30

Choose a tag to compare

Remove

  • [BREAKING] Remove builtin multipart/form-data encoder and all related methods. You need check if your HTTP client supports spec-compliant FormData in Node.js and if it don't, then you can suggest them to implement multipart/form-data encoding or use form-data-encoder package;
  • [BREAKING] Remove support for Buffer and ReadStream (the one you might create with fs.createReadStream), you can use Blob, fileFromPath and fileFromPathSync to replace them. Other async data sources are still supported - see documentation for more information;
  • Remove polyfill entry points;
  • Remove unused helpers and reduce overall size of the project.

Update

  • [BREAKING] Set minimal required Node.js version to 12.20;
  • [BREAKING] Separate fileFromPath functions from main entry point:
- import {fileFromPath, fileFromPathSync} from "formdata-node"
+ import {fileFromPath, fileFromPathSync} from "formdata-node/file-from-path"

This subpath is NOT available in browsers!

  • [BREAKING] Expose isFile from file-from-path subpath;
- import {isFileLike} from "formdata-node"
+ import {isFile} from "formdata-node/file-from-path"
  • [BREAKING] Rename FormDataFieldValue type to FormDataEntryValue (TypeScript specific);
  • Fix message for the error thrown when filename argument passed with non-File value to set() or append();
  • Improved documentation.

Closes #42
All changes: v3.7.0...v4.0.0