Skip to content

the v3 plan? #635

Open
Open
@tunnckoCore

Description

@tunnckoCore

Okay, some thoughts.

I think we can just wrap the Node's stream.pipeline() and provide it to our users, but they still will be able to do whatever they want, using the Node's pipeline(). Something like this

const { pipeline, MultipartParser, formidable } = require('formidable');

// accepts a callback, or returns a promise if no cb
const { fields, files } = await pipeline(req, formidableOptions);

// if they want more transform or whatever,
// they can add more things, just like in the Node's pipeline()
const { fields, files } = await pipeline(
  req,
  ...streams,
  ...iterators,
);

// or directly using the native pipeline()

const parser = new MultipartParser(); // it's Transform Stream

await promisify(stream.pipeline)(
  req,
  parser,
  formidable(),
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: In ProgressThis issue is being worked on, and has someone assigned.Type: DiscussionsThings that need discussion. Brainstorming.Type: MaintenanceUpdating phrasing or wording to make things clearer or removing ambiguity, without a functionality.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions