{"id":27619,"library":"body-parser-with-msgpack","title":"body-parser-with-msgpack","description":"Express-compatible body parsing middleware for Node.js (v1.17.0) that extends the popular body-parser module with MessagePack (msgpack) support. In addition to JSON, URL-encoded, raw, and text parsers, it provides a dedicated msgpack parser for binary MessagePack requests. Maintained as a fork, it includes automatic gzip/deflate inflation, configurable limits, and strict mode. Compatible with Node >= 0.8, intended for use with Express or Connect.","status":"active","version":"1.17.0","language":"javascript","source_language":"en","source_url":"https://github.com/MobiltronInc/body-parser","tags":["javascript","express","expressjs","messagepack","msgpack","body-parser"],"install":[{"cmd":"npm install body-parser-with-msgpack","lang":"bash","label":"npm"},{"cmd":"yarn add body-parser-with-msgpack","lang":"bash","label":"yarn"},{"cmd":"pnpm add body-parser-with-msgpack","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Parsing request body size limits.","package":"bytes","optional":false},{"reason":"Parsing Content-Type header.","package":"content-type","optional":false},{"reason":"Logging for debugging.","package":"debug","optional":false},{"reason":"Deprecation warnings for deprecated argument signatures.","package":"depd","optional":false},{"reason":"Creating HTTP error objects for error responses.","package":"http-errors","optional":false},{"reason":"Character encoding conversion.","package":"iconv-lite","optional":false},{"reason":"Execute a callback when the request finishes.","package":"on-finished","optional":false},{"reason":"Parsing URL-encoded bodies with extended query string support.","package":"qs","optional":false},{"reason":"Getting the raw body from a readable stream.","package":"raw-body","optional":false},{"reason":"Content-Type inspection via mime type or extension.","package":"type-is","optional":false},{"reason":"MessagePack serialization/deserialization.","package":"msgpack5","optional":false}],"imports":[{"note":"This package does not ship ESM; use CommonJS require.","wrong":"import bodyParser from 'body-parser-with-msgpack'","symbol":"bodyParser","correct":"const bodyParser = require('body-parser-with-msgpack')"},{"note":"The method name is lowercase 'json', not 'JSON'.","wrong":"bodyParser.JSON()","symbol":"bodyParser.json","correct":"bodyParser.json({ limit: '1mb' })"},{"note":"This parser is unique to this fork. Do not confuse with the official body-parser.","wrong":"bodyParser.messagepack() or bodyParser.msgpack() from body-parser","symbol":"bodyParser.msgpack","correct":"bodyParser.msgpack({ limit: '2mb' })"}],"quickstart":{"code":"const express = require('express');\nconst bodyParser = require('body-parser-with-msgpack');\n\nconst app = express();\n\n// Parse JSON bodies\napp.use(bodyParser.json());\n\n// Parse MessagePack bodies\napp.use(bodyParser.msgpack({ limit: '2mb' }));\n\napp.post('/data', (req, res) => {\n  res.json({\n    received: req.body,\n    type: typeof req.body === 'object' ? 'object' : 'other'\n  });\n});\n\napp.listen(3000, () => console.log('Server running on port 3000'));","lang":"javascript","description":"Creates an Express app that parses JSON and MessagePack request bodies, echoes back the parsed body."},"warnings":[{"fix":"If you need full MessagePack support (e.g., timestamps, custom types), consider using msgpack5 directly or another library.","message":"The msgpack parser uses msgpack5 library internally; it does not support the full MessagePack spec extensions.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use Buffer.isBuffer(req.body) to detect binary data, or rely on msgpack5 behavior.","message":"Parsed MessagePack body may be a Buffer (for binary data) or an object/array. Ensure your handler checks the type.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use 'inflate' option instead of 'infalting'.","message":"The 'inflation' option in earlier versions was misspelled 'infalting'.","severity":"deprecated","affected_versions":"<=1.16.4"},{"fix":"Use the recommended modules for multipart parsing.","message":"This package does not handle multipart bodies. Use busboy, formidable, or multer for multipart.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'0.8':65 'addit':28 'automat':54 'binari':45 'bodi':2,9,20,79 'body-pars':19,78 'body-parser-with-msgpack':1 'compat':8,62 'configur':57 'connect':72 'dedic':41 'encod':33 'express':7,70,74 'express-compat':6 'expressj':75 'extend':16 'fork':51 'gzip/deflate':55 'includ':53 'inflat':56 'intend':66 'javascript':73 'json':30 'limit':58 'maintain':48 'messagepack':24,46,76 'middlewar':11 'mode':61 'modul':22 'msgpack':5,25,42,77 'node':64 'node.js':13 'pars':10 'parser':3,21,37,43,80 'popular':18 'provid':39 'raw':34 'request':47 'strict':60 'support':26 'text':36 'url':32 'url-encod':31 'use':68 'v1.17.0':14","created_at":"2026-05-09T05:51:12.365278+00:00","updated_at":"2026-05-09T05:51:12.365278+00:00","problems":[{"fix":"Run 'npm install body-parser-with-msgpack' and use 'const bodyParser = require(\"body-parser-with-msgpack\")'.","cause":"Package not installed or required incorrectly.","error":"TypeError: bodyParser.json is not a function"},{"fix":"Install the package: 'npm install body-parser-with-msgpack' or if using npm < 3, install msgpack5 manually: 'npm install msgpack5'.","cause":"Missing msgpack5 dependency (should be bundled).","error":"Error: Cannot find module 'msgpack5'"},{"fix":"Add 'const bodyParser = require(\"body-parser-with-msgpack\")' at the top of your file.","cause":"Forgetting to import/require the module.","error":"ReferenceError: bodyParser is not defined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/MobiltronInc/body-parser","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/body-parser-with-msgpack","openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization","web-framework","http-networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-09","next_check":"2026-08-07","install_tag":null}}