Skip to content

4.0.0

Choose a tag to compare

@octet-stream octet-stream released this 17 Aug 15:30

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