Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

amp-message

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amp-message

Higher level Message object for the AMP protocol

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.3M
decreased by-5.14%
Maintainers
1
Weekly downloads
 
Created

What is amp-message?

The amp-message npm package is used for encoding and decoding messages in the Advanced Message Queuing Protocol (AMQP) format. It is particularly useful for applications that need to communicate over message queues, providing a simple and efficient way to handle message serialization and deserialization.

What are amp-message's main functionalities?

Encoding Messages

This feature allows you to encode an array of strings into a buffer that can be sent over a message queue. The `amp.Message` constructor takes an array of strings and the `toBuffer` method converts it into a buffer.

const amp = require('amp-message');
const msg = new amp.Message(['Hello', 'World']);
const buf = msg.toBuffer();
console.log(buf);

Decoding Messages

This feature allows you to decode a buffer back into its original message format. The `amp.Message` constructor can also take a buffer, and the `args` property will contain the decoded message.

const amp = require('amp-message');
const buf = Buffer.from([0, 1, 2, 3, 4, 5]);
const msg = new amp.Message(buf);
console.log(msg.args);

Other packages similar to amp-message

Keywords

FAQs

Package last updated on 13 Nov 2013

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