New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

milliparsec

Package Overview
Dependencies
Maintainers
0
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

milliparsec

tiniest body parser in the universe

  • 5.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
58K
decreased by-1.09%
Maintainers
0
Weekly downloads
 
Created
Source





Version Coverage Github actions Downloads


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
  • ⚡ 40% faster than body-parser and 20x 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.

Keywords

FAQs

Package last updated on 22 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc