node-formidable / formidable

The most used, flexible, fast and streaming parser for multipart form data. Supports uploading to serverless environments, AWS S3, Azure, GCP or the filesystem. Used in production.
MIT License
7k stars 680 forks source link

Maintainer Wanted #412

Open felixge opened 7 years ago

felixge commented 7 years ago

I haven't maintained this module in a while*, and PRs are piling up.

If anybody is interested in helping out, I'm happy to give commit bits + npm package access.

To get access, please try to write 1-2 sentences that give me a reasonable hope you're not looking to put malicious code into the package and also mention your npm account name.

* For those curious about the "why?", I'm working with Go these days haven't been using node.js for over 3 years now.

MaxFichtelmann commented 2 years ago

the change was a fix for #433 some minor changes were needed to make the tests/travis work again/current node versions

details: https://github.com/node-formidable/formidable/compare/v1.2.1...v1.2.3

tunnckoCore commented 2 years ago

Ah, right. Thanks @MaxFichtelmann

GrosSacASac commented 2 years ago

I don't even know how to test if form.pause() and resume work. We have 2 issues around this, and don't know where to start.

wbt commented 2 years ago

I'm a maintainer on the widely-used 'winston' logger (w-b-t on npm; 2FA required for that b/c it's a top-100 package) and while I can't promise any active maintenance here, I might be able to chip in on occasion (example here).

tunnckoCore commented 2 years ago

@wbt great, it's always better to have more hands and eyes. Can add you this next few days. Many things are commented and have opened issues for tracking.

nagy-nabil commented 1 year ago

hello, it's my first time on open source project, I'm curious how parsing multi-part forms work I started my search by looking for the request interface with contenttype="multi-part/form" and I started getting results also I tried to read through "src/Formidable.js", I was wondering can I migrate "@types/formidable" inside the project to make my mission easier any resources to help me understand the parsing process would be appreciated btw I used formidable myself in a couple of projects

tunnckoCore commented 1 year ago

@nagy-nabil welcome to open source! :wave:

Formidable is a very old project (11 years), and its codebase might be a bit unintuitive. There are parts that sit there because of legacy reasons.

To understand the flow and look on a bit more modern base you can check out formidable-mini that I created to play around a while ago, around the same parser. But the whole thing is significantly more small because there are many things that got into the JS/nodejs core like File and FormData. The even funnier thing is that in Nodejs v19.2+ (and in the future v20 LTS) there will be NO need for any package - just 15 lines of code around native things.

For example:

// example request handler (e.g. express middleware, or serverless)
function handler(req, res) {
  // getting/"parsing" file uploads and fields in v19.2+
  const resp = new Response(req, { headers: req.headers });
  const form = await resp.formData();

  console.log([...form.entries()]);
}

This magic works, because the competitor package busbuy got into Nodejs Core. There was discussion to be formidable or busboy and they picked Busboy because it was bumped to v1 this year and it's probably a bit faster nowadays but that can change soon.

Btw, Formidable's parser is used in node-fetch too. It was copy pasted without any note or attribution anywhere. And I copy pasted the modernized variant into formidable-mini too. I tried some benchmarks there too, and from what I'm seeing, it's on par with the latest busboy that got into the Node Core.

The parser itself... it's tricky but kind of easy to follow and understand (it's the least touched thing over the years), if you are into parsing in general tho, it's not my specialty.. haha. I think to write a new parser from scratch (for learning purposes) one day based on what I learned over the years here.

Soon I'll buy a domain, create a website and write a long article around Formidable its past, present and future - the whole state of multipart parsing ("A letter to the stakeholders", haha). Because as you can see, its state and existence is... For 11 years, it's everywhere, in every 9 of 10 articles for nodejs multipart parsing and file uploads, even in Node's official website guide about file uploads. And it's STILL the most downloaded, 2x more than Busboy in fact - https://twitter.com/3a1fcBx0/status/1535663399291564047.