
Company News
Socket Has Acquired Secure Annex
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.
milliparsec
Advanced tools
Tiniest body parser in the universe. Built for modern Node.js.
Check out deno-libs/parsec for Deno port.
async / await# pnpm
pnpm i milliparsec
# yarn
yarn add milliparsec
# npm
npm i milliparsec
Use a middleware inside a server:
import { createServer } from 'http'
import { json } from 'milliparsec'
const server = createServer(async (req: ReqWithBody, res) => {
await json()(req, res, (err) => void err && console.log(err))
res.setHeader('Content-Type', 'application/json')
res.end(JSON.stringify(req.body))
})
import { App } from '@tinyhttp/app'
import { urlencoded } from 'milliparsec'
new App()
.use(urlencoded())
.post('/', (req, res) => void res.send(req.body))
.listen(3000, () => console.log(`Started on http://localhost:3000`))
raw(req, res, cb)Minimal body parsing without any formatting.
text(req, res, cb)Converts request body to string.
urlencoded(req, res, cb)Parses request body using new URLSearchParams.
json(req, res, cb)Parses request body using JSON.parse.
custom(fn)(req, res, cb)Custom function for parsec.
// curl -d "this text must be uppercased" localhost
await custom(
req,
(d) => d.toUpperCase(),
(err) => {}
)
res.end(req.body) // "THIS TEXT MUST BE UPPERCASED"
The parsec is a unit of length used to measure large distances to astronomical objects outside the Solar System.
FAQs
tiniest body parser in the universe
The npm package milliparsec receives a total of 56,878 weekly downloads. As such, milliparsec popularity was classified as popular.
We found that milliparsec demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Company News
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.

Research
/Security News
Socket is tracking cloned Open VSX extensions tied to GlassWorm, with several updated from benign-looking sleepers into malware delivery vehicles.

Product
Reachability analysis for PHP is now available in experimental, helping teams identify which vulnerabilities are actually exploitable.