Skip to content

Releases: octet-stream/then-busboy

5.2.1

06 Sep 10:44
Compare
Choose a tag to compare

Update

  • Fix typings exports in package.json

All changes: v5.2.0...v5.2.1

5.2.0

24 May 15:50
Compare
Choose a tag to compare

Add

  • AsyncIterable objects support as the source in parse function. In this case you must provide HTTP headers through options argument. Because of that, you can process multipart/form-data bodies from different sources, even from Response:
import {Response, FormData} from "node-fetch" // Has FormData support from v3
import {parse} from "then-bosboy"
const form = new FormData()

form.set("greeting", "Hello, World!")
form.set("file", new File(["On Soviet Moon landscape see binoculars through YOU"], "file.txt"))

const response = new Respone(form)
// then-busboy will parse the input and return its own Body instance from which you can create a complete object by calling .json() method or a FormData using .formData() method.
// The difference with Response.formData() is that then-busboy will save all files to file system and create a *reference* to each of them,
// while Response (currently) will dump them into RAM, which can be less efficient in some scenarious
const body = await parse(response.body, {
  headers: {
    "content-type": response.headers.get("content-type")
  }
})

body.json() // -> {greeting: string, file: BodyFile}
body.formData() // -> FormData

Update

  • Busboy is updated to version 1.x;
  • Improvements for documentation;
  • Body.json() method takes type parameter that will reflect the type returned by this method (TS only)

All changes: v5.1.3...v5.2.0

5.1.3

18 May 14:45
Compare
Choose a tag to compare

Update

  • Fix for typings: Use Busboy constructor params to extract options (#33)

All changes: v5.1.2...v5.1.3

5.1.2

17 May 22:12
Compare
Choose a tag to compare

Update

  • Move busboy typings to dependencies section.
  • Update nanoid and formdata-node

All changes: v5.1.1...v5.1.2

5.1.1

19 Oct 13:48
Compare
Choose a tag to compare

Update

  • Fix typings for BodyFile.stream() method;
  • Improve in-code documentation;

All changes: v5.1.0...v5.1.1

5.1.0

13 Aug 23:17
Compare
Choose a tag to compare

Update

  • Update object-deep-from-entries to 0.4.0;
  • Expose BodyRawEntry type.

All changes: v5.0.0...v5.1.0

5.0.0

30 Jul 15:53
Compare
Choose a tag to compare

The 5.0.0 release is finally stable 🎉

I'd like to announce that I am finally happy with what I did for the 5th major release of this package, so there's no more upcoming breaking changes and I can release it's first stable version!

The most changes are internal compared to the last beta release, you should not be affected if you use 5.x since its beta.

The following patch notes are for those who still using 4.x

Update

  • Braking! Drop Node.js 10 support. Minimal required version is 12.4.x.
  • Breaking! The project has beed rewritten on TypeScript from the ground up. The package still ships with CJS version, but it will eventually fade away and be replaced with ESM (which is also supported natively from this version);
  • Breaking! File class has been improved to become spec-compatible with the file objects from the browsers. Now it has the same properties and methods as browser implementations. Also, this class has been renamed into BodyFile and no more available for being constructed manually. If you need to add files to Body manually, you have to use regular File class from browsers (you can get it from formdata-node or fetch-blob);
  • Breaking! The Body#paths() method has been renamed to Body#keys();
  • Breaking! The options.restoreTypes parameter has been renamed to options.castTypes.

Remove

  • Breaking! The map, forEach, names, and filter methods has been removed from Body class;
  • Breaking! Removed BodyFile#originalFilename property, the original file name can be read from BodyFile#name property.
  • Breaking! Every non-File spec compatible method and property has been removed, except for BodyFile#enc and BodyFile#path since they might be necessary for debugging or further usage outside of then-busboy

All changes: v4.3.1...v5.0.0

5.0.0-beta.6

15 Jun 14:35
Compare
Choose a tag to compare
5.0.0-beta.6 Pre-release
Pre-release

Update

  • Bump formdata-node to 3.5.4

All changes: v5.0.0-beta.5...v5.0.0-beta.6

5.0.0-beta.5

10 Jun 18:24
Compare
Choose a tag to compare
5.0.0-beta.5 Pre-release
Pre-release

Update

  • Fix types section of package.json with correct path to the TS typings

All changes: v5.0.0-beta.4...v5.0.0-beta.5

5.0.0-beta.4

09 Jun 14:34
Compare
Choose a tag to compare
5.0.0-beta.4 Pre-release
Pre-release

Update

  • Braking! Drop Node.js 10 support. Minimal required version is 12.
  • Breaking! The project has beed rewritten on TypeScript from the ground up. The package still ships with CJS version, but it will eventually fade away and be replaced with ESM (which is also supported natively from this version);
  • Breaking! File class has been improved to become spec-compatible with the file objects from the browsers. Now it has the same properties and methods as browser implementations. Also, this class has been renamed into BodyFile and no more available for being constructed manually. If you need to add files to Body manually, you have to use regular File class from browsers (you can get it from formdata-node or fetch-blob);
  • Breaking! The Body#paths() method has been renamed to Body#keys();
  • Breaking! The options.restoreTypes parameter has been renamed to options.castTypes.

Remove

  • Breaking! The map, forEach, names, and filter methods has been removed from Body class;
  • Breaking! Removed BodyFile#originalFilename property, the original file name can be read from BodyFile#name property.
  • Breaking! Every non-File spec compatible method and property has been removed, except for BodyFile#enc and BodyFile#path since they might be necessary for debugging or further usage outside of then-busboy

All changes: v5.0.0-beta.3...v5.0.0-beta.4