miniparser

1.0.0 • Public • Published

miniparser

Tiny alternative for the popular body-parser package. Zero dependencies vs 21. Just handles JSON for now.

Install

npm i miniparser

Example

const bodyParser = require('miniparser')
require('polka')()
	.use(bodyParser()) // you can also use bodyParser.json()
	.get('/', (req, res) => {
		console.log(req.body)
		res.end()
	})

If the JSON body is misformatted or unable to be parsed, an empty JSON object will be returned ({})

Readme

Keywords

none

Package Sidebar

Install

npm i miniparser

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

2.52 kB

Total Files

4

Last publish

Collaborators

  • coffeeboo