-
-
Notifications
You must be signed in to change notification settings - Fork 691
Open
Labels
Status: In ProgressThis issue is being worked on, and has someone assigned.This issue is being worked on, and has someone assigned.Type: DiscussionsThings that need discussion. Brainstorming.Things that need discussion. Brainstorming.Type: MaintenanceUpdating phrasing or wording to make things clearer or removing ambiguity, without a functionality.Updating phrasing or wording to make things clearer or removing ambiguity, without a functionality.
Description
- require Node 10 or 12
- latest Stream APIs
pipeline(...streams, (err) => {})- https://nodesource.com/blog/understanding-streams-in-nodejs/
- https://nodejs.org/api/stream.html
- https://www.youtube.com/watch?v=aTEDCotcn20 (Matteo Collina, NearForm, Node core)
- Readable Stream by default, Support readstreams #360 ?
- strictly only
multipart/*? - util wrappers around iterators & async iterators
- rewrite MultipartParser class to async generator function?
- so we can
Readable.from(multipart())?
- so we can
- compatible (make use of)
VFileorVinyl? v2?- battles path related things and opreatons
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
Labels
Status: In ProgressThis issue is being worked on, and has someone assigned.This issue is being worked on, and has someone assigned.Type: DiscussionsThings that need discussion. Brainstorming.Things that need discussion. Brainstorming.Type: MaintenanceUpdating phrasing or wording to make things clearer or removing ambiguity, without a functionality.Updating phrasing or wording to make things clearer or removing ambiguity, without a functionality.