# expressjs/body-parser

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/expressjs-body-parser).**

5,499 stars · 757 forks · JavaScript · MIT

## Links

- GitHub: https://github.com/expressjs/body-parser
- awesome-repositories: https://awesome-repositories.com/repository/expressjs-body-parser.md

## Topics

`body` `expressjs` `javascript` `json` `middleware` `nodejs` `parser` `urlencoded`

## Description

body-parser is a Node.js HTTP request parser that converts incoming request bodies into structured JavaScript objects. It provides utilities to extract and process JSON, raw binary, plain text, and URL-encoded payloads for use in web servers.

The project employs a middleware pattern to augment request objects, attaching parsed data directly to the request for use in subsequent route handlers. It uses content-type based dispatching to select the appropriate parsing logic based on the request headers.

The tool manages data streams by consuming payloads in chunks and accumulating binary buffers. It supports encoding-aware string decoding to handle various character sets before transforming the accumulated data into a usable format.

## Tags

### Networking & Communication

- [JSON](https://awesome-repositories.com/f/networking-communication/communication-protocols-architectures/request-processing-architectures/request-parsers/json.md) — Provides middleware that automatically parses incoming JSON request bodies into JavaScript objects.
- [MIME-Aware Content Parsers](https://awesome-repositories.com/f/networking-communication/mime-aware-content-parsers.md) — Selects the appropriate parsing strategy based on the request's MIME type header.
- [Buffer-Based Memory Management](https://awesome-repositories.com/f/networking-communication/request-payloads/memory-efficient-payload-buffering/buffer-based-memory-management.md) — Uses raw binary buffers to accumulate request data for efficient memory management and deferred parsing.

### Data & Databases

- [JSON Parsers](https://awesome-repositories.com/f/data-databases/json-parsers.md) — Ships a utility that converts JSON-formatted request payloads into JavaScript objects.
- [Binary Data Buffers](https://awesome-repositories.com/f/data-databases/data-buffering/binary-data-buffers.md) — Handles incoming request bodies as binary buffers for processing raw data streams.

### Web Development

- [Request Body Parsers](https://awesome-repositories.com/f/web-development/backend-development/middleware-pipelines/request-body-parsers.md) — Provides a processor that extracts the body of an incoming HTTP request as a plain string.
- [Node.js Request Parsers](https://awesome-repositories.com/f/web-development/node-js-request-parsers.md) — Provides middleware for Node.js that parses incoming request bodies into usable JavaScript objects.
- [Request Body Extraction](https://awesome-repositories.com/f/web-development/request-body-extraction.md) — Extracts text or binary payloads from incoming HTTP requests to be used as input for server-side logic.
- [JSON Parsers](https://awesome-repositories.com/f/web-development/request-body-handling/request-body-alterations/request-body-parsing/json-parsers.md) — Provides a parser that converts incoming JSON request bodies into structured JavaScript objects. ([source](https://github.com/expressjs/body-parser#readme))
- [Raw Binary Parsers](https://awesome-repositories.com/f/web-development/request-body-handling/request-body-alterations/request-body-parsing/raw-binary-parsers.md) — Allows reading incoming request bodies as raw binary buffers for custom content types. ([source](https://github.com/expressjs/body-parser#readme))
- [Text Parsers](https://awesome-repositories.com/f/web-development/request-body-handling/request-body-alterations/request-body-parsing/text-parsers.md) — Extracts the body of an incoming request as a plain string. ([source](https://github.com/expressjs/body-parser#readme))
- [URL-Encoded Parsers](https://awesome-repositories.com/f/web-development/request-body-handling/request-body-alterations/request-body-parsing/url-encoded-parsers.md) — Transforms URL-encoded request bodies into structured key-value pairs. ([source](https://github.com/expressjs/body-parser/blob/master/README.md))
- [Request Body Parsers](https://awesome-repositories.com/f/web-development/request-body-parsers.md) — Provides a handler that reads incoming request bodies as binary buffers for raw data processing.
- [Request Middleware](https://awesome-repositories.com/f/web-development/request-middleware.md) — Implements a middleware pattern to attach parsed bodies to the request object for use in route handlers.
- [URL-Encoded Body Parsing](https://awesome-repositories.com/f/web-development/url-encoded-body-parsing.md) — Processes form submissions and URL encoded request bodies into key-value pairs.
- [Payload Streaming](https://awesome-repositories.com/f/web-development/backend-development/request-response-handling/http-request-handling/payload-streaming.md) — Reads incoming request streams in chunks to assemble the full body before processing.

### Programming Languages & Runtimes

- [JSON Parsing](https://awesome-repositories.com/f/programming-languages-runtimes/json-parsing.md) — Utilizes native methods like JSON.parse to synchronously transform accumulated strings into JavaScript objects.

### Software Engineering & Architecture

- [Text Encoding and Decoding](https://awesome-repositories.com/f/software-engineering-architecture/string-validation-and-normalization/string-encodings/utf-16-encodings/text-encoding-and-decoding.md) — Converts binary buffers into text using specified character sets like UTF-8 or ISO-8859-1.

### Part of an Awesome List

- [Database and Backend](https://awesome-repositories.com/f/awesome-lists/data/database-and-backend.md) — Middleware for parsing incoming request bodies in Node.js.
