{"id":15007673,"url":"https://github.com/textbook/express-msgpack","last_synced_at":"2025-07-19T22:39:32.252Z","repository":{"id":41251425,"uuid":"190814739","full_name":"textbook/express-msgpack","owner":"textbook","description":"Transparent MessagePack middleware for Express // msgpack.org[JavaScript]","archived":false,"fork":false,"pushed_at":"2024-05-17T19:26:41.000Z","size":2673,"stargazers_count":7,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-09-28T15:21:06.716Z","etag":null,"topics":["express","express-js","express-middleware","express-msgpack","expressjs","javascript","messagepack","middleware","msgpack","npm","npm-package","npmjs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/express-msgpack","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/textbook.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-07T22:01:39.000Z","updated_at":"2024-05-17T19:26:43.000Z","dependencies_parsed_at":"2024-06-20T22:00:52.063Z","dependency_job_id":null,"html_url":"https://github.com/textbook/express-msgpack","commit_stats":{"total_commits":533,"total_committers":5,"mean_commits":106.6,"dds":0.2045028142589118,"last_synced_commit":"b9ae87fa90d661316c8be2af23cabdceeb2d6ef8"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textbook%2Fexpress-msgpack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textbook%2Fexpress-msgpack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textbook%2Fexpress-msgpack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textbook%2Fexpress-msgpack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/textbook","download_url":"https://codeload.github.com/textbook/express-msgpack/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219856362,"owners_count":16556084,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["express","express-js","express-middleware","express-msgpack","expressjs","javascript","messagepack","middleware","msgpack","npm","npm-package","npmjs"],"created_at":"2024-09-24T19:13:19.879Z","updated_at":"2024-10-12T08:04:06.526Z","avatar_url":"https://github.com/textbook.png","language":"TypeScript","readme":"# Express Msgpack\n\n[![License](https://img.shields.io/github/license/textbook/express-msgpack.svg)](https://github.com/textbook/express-msgpack/blob/main/LICENSE)\n[![Build Status](https://github.com/textbook/express-msgpack/workflows/Node.js%20CI/badge.svg?branch=main)](https://github.com/textbook/express-msgpack/actions)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/e9a820ea77a01c1ba8bb/test_coverage)](https://codeclimate.com/github/textbook/express-msgpack/test_coverage)\n[![Maintainability](https://api.codeclimate.com/v1/badges/e9a820ea77a01c1ba8bb/maintainability)](https://codeclimate.com/github/textbook/express-msgpack/maintainability)\n[![NPM Version](https://img.shields.io/npm/v/express-msgpack.svg)](https://www.npmjs.com/package/express-msgpack)\n\n[Express] and [MessagePack], together at last. Uses [`@msgpack/msgpack`][1] by default.\n\n## Functionality\n\nProvides transparent middleware that can be used to support clients requesting\n`Accept: application/msgpack` from endpoints using `res.json` or sending\n`Content-Type: application/msgpack` to any endpoint. You can continue to use\n`req.body` and `res.json` and `expressMsgpack` will handle the conversion in\nthe background using `@msgpack/msgpack` (or any compatible library of your\nchoice).\n\n## Installation\n\n```bash\n$ npm install --save express-msgpack\n// or\n$ yarn add express-msgpack\n```\n\nIf you intend to use an alternative to `@msgpack/msgpack` (see Configuration)\nyou can add the `--no-optional` flag; it's an optional dependency.\n\n## Usage\n\n```javascript\nimport msgpack from \"express-msgpack\";\n\n// ...\napp.use(msgpack());\n```\n\n### CommonJS\n\n```javascript\nconst msgpack = require(\"express-msgpack\").default;\n\n// ...\napp.use(msgpack());\n```\n\n## Configuration\n\nTo configure, pass options when you configure the middleware. Currently supported options are:\n\n| Parameter  | Description                                              | Default                                                                      |\n|------------|----------------------------------------------------------|------------------------------------------------------------------------------|\n| `decoder`  | a function converting from MessagePack to JavaScript     | `@msgpack/msgpack#decode`                                                    |\n| `encoder`  | a function converting from JavaScript to MessagePack     | `@msgpack/msgpack#encode` (with a wrapper to convert the result to a Buffer) |\n| `mimeType` | the MIME type to detect and set for MessagePack payloads | `\"application/msgpack\"`                                                      |\n| `limit`    | The byte limit of the body. This is the number of bytes or any string format supported by [bytes](https://www.npmjs.com/package/bytes) | `\"100kb\"`                                                      |\n\nFor example, to switch to the node-gyp C++ based [msgpack] library:\n\n```javascript\nimport msgpack from \"express-msgpack\";\nimport { pack, unpack } from \"msgpack\";\n\n// ...\napp.use(msgpack({ decoder: unpack, encoder: pack }));\n```\n\n## Development\n\nThe project has code linting and testing, using the following commands:\n\n  - `npm run e2e`: run the smoke/E2E tests\n  - `npm run lint`: run the ESLint checks\n  - `npm run ship`: lint and run unit, integration and E2E tests\n  - `npm test`: run the Jest unit and integration tests\n  - `npm test:watch`: run the tests in watch mode\n\nThe tests are in the `__tests__/` directory and are run using [Jest]. They're\nsplit into two files:\n\n  - `unit.test.ts` - mockist unit tests, to check specific internal details\n  - `integration.test.ts` - integration tests using [SuperTest] with a simple\n    Express app using the middleware\n\nThere is also a `smoke/` directory containing E2E/smoke tests for a deployed\nversion of the package, used by `bin/smoke.sh`. If the `--local` argument is\nsupplied to the script the local version is packaged and tested , otherwise\nthe specified `$TAG` version is installed from the registry and tested.\n\n[Express]: https://expressjs.com/\n[Jest]: https://jestjs.io/\n[MessagePack]: https://msgpack.org/\n[msgpack]: https://www.npmjs.com/package/msgpack\n[SuperTest]: https://github.com/visionmedia/supertest\n[1]: https://www.npmjs.com/package/@msgpack/msgpack\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftextbook%2Fexpress-msgpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftextbook%2Fexpress-msgpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftextbook%2Fexpress-msgpack/lists"}