Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

NotificationsYou must be signed in to change notification settings

tinyhttp/milliparsec

Repository files navigation






VersionCoverageGithub actionsDownloads


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

Check outdeno-libs/parsec for Deno port.

Features

  • 🛠 JSON / raw / urlencoded / multipart support
  • 📦 tiny package size (8KB dist size)
  • 🔥 no dependencies
  • tinyhttp and Express support
  • ⚡ 40% faster than body-parser and 20x faster than formidable

Install

# pnpmpnpm i milliparsec# bunbun i milliparsec

Usage

Basic example

Use a middleware inside a server:

import{createServer}from'node:http'import{json}from'milliparsec'constserver=createServer(async(req:ReqWithBody,res)=>{awaitjson()(req,res,(err)=>voiderr&&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 astronomicalobjects outside the Solar System.

Sponsor this project

    Contributors8


    [8]ページ先頭

    ©2009-2025 Movatter.jp