Skip to content

Commit

Permalink
Update CJS/ESM section mentioning support for both. Add a note at the…
Browse files Browse the repository at this point in the history
… start of the docs. Add Requirements section
  • Loading branch information
octet-stream committed Oct 24, 2023
1 parent 1330efe commit fe8bcbd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
**FOLLOWING DOCUMENTATION IS RELATED TO *UPCOMING MAJOR RELEASE*. IF YOU ARE LOOKING FOR DOCUMENTATION FOR *CURRENT RELEASE*, PLEASE CHECK OUT THE [`5.x`](https://github.com/octet-stream/form-data/tree/5.x) BRANCH**

# FormData

Spec-compliant [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) implementation for Node.js
Expand All @@ -7,6 +9,10 @@ Spec-compliant [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/For
[![ESLint](https://github.com/octet-stream/form-data/workflows/ESLint/badge.svg)](https://github.com/octet-stream/form-data/actions/workflows/eslint.yml)
[![TypeScript Types](https://github.com/octet-stream/form-data/actions/workflows/typescript.yml/badge.svg)](https://github.com/octet-stream/form-data/actions/workflows/typescript.yml)

## Requirements

For this module to work consider polyfilling: [ReadableStream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream), and [DOMException](https://developer.mozilla.org/en-US/docs/Web/API/DOMException) (if you use `file-from-path` utilities)

## Highlights

1. Spec-compliant: implements every method of the [`FormData interface`](https://developer.mozilla.org/en-US/docs/Web/API/FormData).
Expand Down Expand Up @@ -41,7 +47,7 @@ pnpm add formdata-node

## ESM/CJS support

This package is native [ESM](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) and no longer provides CommonJS exports. Use `4.x` version if you still need to use this package with CommonJS, or use [dynamic `import()`](https://v8.dev/features/dynamic-import) syntax.
This package is build for and bundled for both ESM and CommonJS, so you can use it in both environments.

## Usage

Expand Down

0 comments on commit fe8bcbd

Please sign in to comment.