1.0.0 • Published 3 years ago

hexnut-bodyparser v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

hexnut-bodyparser

hexnut-bodyparser is a hexnut middleware for automatically parsing messages received. It can also be used with hexnut-client.

Installing

npm i hexnut-bodyparser

Usage

JSON

bodyparser.json(settings)

const bodyparser = require('hexnut-bodyparser');

// Will *not* throw if messages cannot be parsed
app.use(bodyparser.json());

// *Will* throw if messages cannot be parsed
app.use(bodyparser.json({ strictParsing: true }));