New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

elysia-msgpack

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elysia-msgpack - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

5

package.json
{
"name": "elysia-msgpack",
"version": "0.0.1",
"version": "0.0.2",
"module": "src/index.js",
"type": "module",
"scripts": {
"prepublishOnly": "tsc",
"dev": "bun run --watch src/index.ts",

@@ -15,3 +16,3 @@ "lint": "eslint \"src/**/*.{ts,tsx,js,mjs,cjs}\"",

"peerDependencies": {
"elysia": "^0.7.29"
"elysia": "^0.7.0"
},

@@ -18,0 +19,0 @@ "devDependencies": {

46

README.md
# elysia-msgpack
A library for [elysia](elysia) that allows you to work with [MessagePack](https://msgpack.org/)
A library for [elysia](elysia) that allows you to work with [MessagePack](https://msgpack.org/). To pack/unpack it we use really fast [msgpackr](https://github.com/kriszyp/msgpackr)

@@ -15,13 +15,37 @@ ## Example

.post("/", ({ body }) => {
//body is unpacked MessagePack if content-type header contains application/x-msgpack
// body is unpacked MessagePack if content-type header contains application/x-msgpack
// if accept header contains application/x-msgpack
// this response will become a MessagePack,
// and if not, it will remain JSON
return {
some: "values",
and: true,
keys: 228,
}
})
// if accept header contains application/x-msgpack
// this response will become a MessagePack,
// and if not, it will remain JSON
return {
some: "values",
and: true,
keys: 228,
}
})
.listen(3000)
```
### Options
[All options of msgpackr constructor](https://github.com/kriszyp/msgpackr?tab=readme-ov-file#options)
and `mimeType` - it's value to detect msgpack content-type and responding with it if accept contains this `mimeType`. Default is `application/x-msgpack`.
<!-- prettier-ignore -->
```ts
new Elysia()
.use(msgpack({
mimeType: "application/some-another-msgpack-type",
int64AsType: "string",
// and other msgpackr constructor options
}))
```
You can use [Apidog](https://apidog.com/) to test the API with msgpack.
<div align='center'>
<img src="https://github.com/kravetsone/elysia-msgpack/assets/57632712/25a3761e-4121-4849-9d77-a73b96227685" alt="Apidog" />
</div>
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc