Skip to content

biscuitsan/miniparser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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 ({})

About

A tiny replacement for body-parser.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published