| description | Modern alternatives to the body-parser package for parsing HTTP request bodies in Node.js servers |
|---|
milliparsec is a lightweight alternative to body-parser with a smaller footprint.
Example:
import bodyParser from 'body-parser' // [!code --]
import { json, urlencoded } from 'milliparsec' // [!code ++]
import express from 'express'
const app = express()
app.use(bodyParser.json()) // [!code --]
app.use(bodyParser.urlencoded({ extended: true })) // [!code --]
app.use(json()) // [!code ++]
app.use(urlencoded()) // [!code ++]For API differences and feature comparison, see the migration.md.