{"id":13411335,"url":"https://github.com/kenriortega/fastify-msgpack","last_synced_at":"2025-04-23T12:27:32.632Z","repository":{"id":57233330,"uuid":"368019532","full_name":"kenriortega/fastify-msgpack","owner":"kenriortega","description":"Fastify and MessagePack, together at last. Uses @msgpack/msgpack by default.","archived":false,"fork":false,"pushed_at":"2021-05-18T22:53:16.000Z","size":341,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T11:42:25.056Z","etag":null,"topics":["fastify","msgpack"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kenriortega.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-17T01:11:06.000Z","updated_at":"2024-04-25T02:20:46.000Z","dependencies_parsed_at":"2022-08-31T14:11:29.351Z","dependency_job_id":null,"html_url":"https://github.com/kenriortega/fastify-msgpack","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenriortega%2Ffastify-msgpack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenriortega%2Ffastify-msgpack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenriortega%2Ffastify-msgpack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenriortega%2Ffastify-msgpack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kenriortega","download_url":"https://codeload.github.com/kenriortega/fastify-msgpack/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250433067,"owners_count":21429801,"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":["fastify","msgpack"],"created_at":"2024-07-30T20:01:12.983Z","updated_at":"2025-04-23T12:27:32.608Z","avatar_url":"https://github.com/kenriortega.png","language":"JavaScript","funding_links":[],"categories":["Web Development"],"sub_categories":["Javascript"],"readme":"# Fastify-msgpack\n\nFastify and MessagePack, together at last. Uses @msgpack/msgpack by default.\n\n## Functionality\n\nProvides transparent middleware that can be used to support clients requesting Accept: application/msgpack from endpoints using res.json or sending Content-Type: application/msgpack to any endpoint. You can continue to use req.body and res.json and fastifyMsgpack will handle the conversion in the background using @msgpack/msgpack.\n\nInstallation\n------------\n\n```bash\n$ npm install --save fastify-msgpack\n// or\n$ yarn add fastify-msgpack\n```\nTest\n----\n```bash\n$ npm test\n\n```\n\nUsage\n-----\n\n```javascript\nconst fastifyMsgpack = require(\"fastify-msgpack\");\n\n// ...\n// custom plugin\nfastify.register(fastifyMsgpack)\n```\n\nUsage in a simple app\n---------------------\n\n```javascript\n'use strict'\n\nconst fastify = require('fastify')({\n    logger: true\n})\n\n// custom plugin\nfastify.register(require('fastify-msgpack'))\n\nfastify.post('/decode', (req, reply) =\u003e {\n    // http POST http://localhost:5000/decode Accept:application/msgpack Content-Type:application/msgpack @msgpack\\package-msgpack.dat\n\n    const body = req.body\n    return body\n})\nfastify.get('/encode', (req, reply) =\u003e {\n    // http http://localhost:5000/encode Accept:application/msgpack\n\n    reply.send({ hello: 'fastify-plugin' })\n})\n\nconst start = async () =\u003e {\n    try {\n        await fastify.listen(5000)\n    } catch (err) {\n        fastify.log.error(err)\n        process.exit(1)\n    }\n}\n\nstart()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenriortega%2Ffastify-msgpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkenriortega%2Ffastify-msgpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenriortega%2Ffastify-msgpack/lists"}