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.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

is v3 ESM only?

phpbg opened this issue · comments

Support plan

  • which support plan is this issue covered by? (e.g. Community, Sponsor, or
    Enterprise): community
  • is this issue currently blocking your project? (yes/no): no
  • is this issue affecting a production system? (yes/no): no

Context

  • node version: 18
  • module (formidable) version: 2
  • environment (e.g. node, browser, native, OS): node
  • used with (i.e. popular names of modules):
  • any other relevant information:

What problem are you trying to solve?

I am currently on v2 and I wonder wether to update to v3 or not.

My project is still using commonjs, but it seems v3 is ESM only.

This package is a ESM package. Your project needs to be ESM too. [Read more](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).

Do you have a new or modified API suggestion to solve the problem?

n/a

Did you read the changelog ?

Yes

* feat: Use ES modules ([#727](https://github.com/node-formidable/formidable/pull/727))

I think @GrosSacASac could have said it immediately instead, since it's quite buried in the changelog, and most users don't read it to begin with. Just answering the question immediately would save everyone a lot of time, but that's just my opinion :)

Hi,

yes, I did read the changelog, but AFAIK the fact that you internally use ESM does not imply that you don't built with commonJS support (sorry i'am not sure about it).

At least I would say it is not quite obvious, and it is not a feature, but a breaking change...

Is it a good idea to make it work both with commonjs and esmodules ?

Is it a good idea to make it work both with commonjs and esmodules ?

Well, it depends on your v2 vs v3 strategy.

If you want to promote v3 for everyone, I suggest you make it work for both.

Anyway it would be great to make a clear statement in your readme

Published formidable@3.5.0

Thank you!

I guess I have to move on 3.5+ now ;-)