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

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

  • 0.0.3
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

elysia-msgpack

A library for elysia which allows you to work with MessagePack. To pack/unpack it, we use really fast msgpackr

Installation

bun i elysia-msgpack

Usage

import Elysia from "elysia"
import { msgpack } from "elysia-msgpack"

new Elysia()
    .use(msgpack())
    .post("/", ({ body }) => {
        // 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,
        }
    })
    .listen(3000)

Options

All options of msgpackr constructor

and mimeType - it's value to detect msgpack content-type and responding with it if accept contains this mimeType. Default is application/x-msgpack.

new Elysia()
    .use(msgpack({
        mimeType: "application/some-another-msgpack-type",
        int64AsType: "string",
        // and other msgpackr constructor options
    }))

You can use Apidog to test the API with msgpack.

Apidog

FAQs

Package last updated on 24 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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