# milliparsec

> tiniest body parser in the universe

Latest version **5.1.2** (published 2026-09-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install milliparsec
pnpm add milliparsec
yarn add milliparsec
bun add milliparsec
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 5.1.2 |
| Published | 2026-09-01 |
| First published | 2020-10-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=18.13 \|\| >=19.20 \|\| >=20 |
| Dependencies | 0 |
| Unpacked size | 14.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 208 |
| Author | talentlessguy |
| Maintainers | v1rtl |
| Keywords | body-parser, express, http, body-parsing |

## Links

- npm: https://www.npmjs.com/package/milliparsec
- Repository: https://github.com/tinyhttp/milliparsec
- Homepage: https://github.com/tinyhttp/milliparsec#readme
- Issues: https://github.com/tinyhttp/milliparsec/issues
- npm.io page: https://npm.io/package/milliparsec

## Recent versions

- 5.1.2 (latest) — 2026-09-01
- 5.1.1 — 2026-02-09
- 5.1.0 — 2025-09-12
- 5.0.2 — 2025-02-22
- 5.0.1 — 2024-11-23
- 5.0.0 — 2024-10-03
- 4.0.0 — 2024-09-11
- 3.0.0 — 2024-07-03
- 2.3.0 — 2023-05-04
- 2.2.2 — 2022-05-30
- 2.2.1 — 2022-01-27
- 2.2.0 — 2021-06-27
- 2.1.1 — 2021-06-25
- 2.1.0 — 2021-06-25
- 2.0.5 — 2021-05-16
- … 15 more at https://npm.io/package/milliparsec/versions

## README

<div align="center">
<br /><br /><br />
<img src="logo.png" width="400px" />
<br /><br />

[![Version][v-badge-url]][npm-url] [![Coverage][cov-img]][cov-url]
[![Github actions][gh-actions-img]][github-actions]
[![Downloads][dl-badge-url]][npm-url]

</div>
<br />

Tiniest body parser in the universe. Built for modern Node.js.

Check out [deno-libs/parsec](https://github.com/deno-libs/parsec) for Deno port.

## Features

- 🛠 JSON / raw / urlencoded / multipart support
- 📦 tiny package size (8KB dist size)
- 🔥 no dependencies
- ✨ [tinyhttp](https://github.com/tinyhttp/tinyhttp) and Express support
- ⚡ ~15% faster than body-parser, ~4x faster than formidable

## Install

```sh
# pnpm
pnpm i milliparsec

# bun
bun i milliparsec
```

## Usage

### Basic example

Use a middleware inside a server:

```js
import { createServer } from 'node:http'
import { json } from 'milliparsec'

const server = createServer(async (req: ReqWithBody, res) => {
  await json()(req, res, (err) => void err && res.end(err))

  res.setHeader('Content-Type', 'application/json')

  res.end(JSON.stringify(req.body))
})
```

### What is "parsec"?

The parsec is a unit of length used to measure large distances to astronomical
objects outside the Solar System.

[v-badge-url]: https://img.shields.io/npm/v/milliparsec.svg?style=for-the-badge&color=25608B&logo=npm&label=
[npm-url]: https://www.npmjs.com/package/milliparsec
[dl-badge-url]: https://img.shields.io/npm/dt/milliparsec?style=for-the-badge&color=25608B
[github-actions]: https://github.com/talentlessguy/milliparsec/actions
[gh-actions-img]: https://img.shields.io/github/actions/workflow/status/tinyhttp/milliparsec/main.yml?branch=master&style=for-the-badge&color=25608B&label=&logo=github
[cov-img]: https://img.shields.io/coveralls/github/tinyhttp/milliparsec?style=for-the-badge&color=25608B
[cov-url]: https://coveralls.io/github/tinyhttp/milliparsec

---
_Source: https://npm.io/package/milliparsec · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
