项目
在 GitHub 查看
tinyhttp/milliparsec
关于
🌌 Tiniest body parser in the universe. Built for modern Node.js
开发工具可以做什么
- 🛠 JSON / raw / urlencoded / multipart support
- 📦 tiny package size (8KB dist size)
- 🔥 no dependencies
- ✨ tinyhttp and Express support
实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- +1
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Tiniest body parser in the universe. Built for modern Node.js.
Check out deno-libs/parsec for Deno port.
Features
- 🛠 JSON / raw / urlencoded / multipart support
- 📦 tiny package size (8KB dist size)
- 🔥 no dependencies
- ✨ tinyhttp and Express support
- ⚡ ~15% faster than body-parser, ~4x faster than formidable
Install
# pnpm
pnpm i milliparsec
# bun
bun i milliparsec
Usage
Basic example
Use a middleware inside a server:
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.
探索相关项目
加载中…