Knowledge Base updated: 2026-11-08
Formidable knowledge base
Formidable is a Node.js library for parsing incoming HTTP form requests, including multipart uploads and structured request bodies.
Its core flow centers on IncomingForm: request configuration, content-type plugin selection, streaming parsing, field/file collection, and lifecycle events.
Upload state is held by form instances and file representations; persistent files manage filesystem-backed writes while volatile files retain non-persistent upload data.
flowchart LR
App[Application / HTTP server] --> Form[IncomingForm]
Form --> Plugins[Content-type plugins]
Plugins --> Multipart[Multipart parser]
Plugins --> JSON[JSON parser]
Plugins --> Query[Querystring parser]
Plugins --> Octet[Octet-stream handler]
Multipart --> Fields[Fields]
Multipart --> Files[File lifecycle]
JSON --> Fields
Query --> Fields
Octet --> Files
Files --> Persistent[PersistentFile]
Files --> Volatile[VolatileFile]
Persistent --> Disk[Filesystem / custom stream]
Form --> Events[Lifecycle events and errors]
Glossary
- IncomingForm — the primary form parser instance and event emitter.
- Plugin — a content-type-specific handler attached to an
IncomingForminstance. - PersistentFile — an uploaded file backed by a write stream and filesystem path.
- VolatileFile — a non-persistent uploaded-file representation.
- Part — a parsed multipart section representing a field or file upload.
Invariants
- Request parsing is coordinated through
IncomingFormand its plugin pipeline (src/Formidable.js,src/plugins/**). - Multipart parsing separates field parts from file parts before the form results are finalized (src/…/multipart.js, src/…/Multipart.js).
- File persistence behavior is represented by distinct file implementations (src/PersistentFile.js, src/VolatileFile.js).
- Parser failures are surfaced through the Formidable error model and form lifecycle (src/errors.js, src/Formidable.js).
Routing table
- src/Formidable.js, src/index.js -> docs/form-request-lifecycle.md
- src/Formidable.js, src/index.js, README.md -> docs/formidable-api-and-events.md
- src/Formidable.js, src/errors.js,
src/parsers/**-> docs/request-options-limits-and-errors.md src/plugins/**, src/Formidable.js -> docs/content-type-plugin-system.md- src/…/multipart.js, src/…/Multipart.js -> docs/multipart-upload-handling.md
- src/…/JSON.js, src/…/Querystring.js, src/…/OctetStream.js, src/…/JSON.js, src/…/Querystring.js -> docs/structured-request-body-parsing.md
- src/PersistentFile.js, src/VolatileFile.js, src/Formidable.js -> docs/file-lifecycle-and-storage.md
- src/PersistentFile.js, src/Formidable.js -> docs/persistent-file-storage.md
- src/VolatileFile.js, src/Formidable.js -> docs/volatile-file-handling.md
- README.md,
examples/**,test/**-> docs/server-integration-patterns.md src/parsers/**,src/helpers/**-> docs/parser-and-stream-utilities.mdbenchmark/**-> docs/performance-benchmarking.md