Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@aws-sdk/eventstream-codec
Advanced tools
[![NPM version](https://img.shields.io/npm/v/@aws-sdk/eventstream-codec/latest.svg)](https://www.npmjs.com/package/@aws-sdk/eventstream-codec) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/eventstream-codec.svg)](https://www.npmjs.com/package/@
The @aws-sdk/eventstream-codec npm package is designed to handle AWS event streams, providing utilities for encoding and decoding messages in the event stream format used by AWS services. This package is particularly useful when working with AWS services that utilize event streams for real-time data processing.
Encoding messages
This feature allows you to encode messages into the AWS event stream format. The `marshall` function takes a message object with headers and a body and returns a Buffer of the encoded message.
const { marshall } = require('@aws-sdk/eventstream-codec');
const message = {
headers: {
':message-type': {
type: 'string',
value: 'event'
},
':event-type': {
type: 'string',
value: 'Records'
}
},
body: Buffer.from('Hello, this is a test message')
};
const encodedMessage = marshall(message);
Decoding messages
This feature enables the decoding of messages from the AWS event stream format. The `unmarshall` function takes a Buffer of an encoded message and returns an object representing the decoded message, including headers and body.
const { unmarshall } = require('@aws-sdk/eventstream-codec');
const encodedMessage = Buffer.from(/* previously encoded message */);
const decodedMessage = unmarshall(encodedMessage);
console.log(decodedMessage);
The 'event-stream' package provides utilities for creating and manipulating streams of data in Node.js. While it offers general stream handling capabilities, it does not specifically target AWS event stream formats like @aws-sdk/eventstream-codec, making it less specialized for AWS event stream handling.
The 'aws-event-stream' package is another tool for handling AWS event streams. It provides similar functionalities to @aws-sdk/eventstream-codec, focusing on encoding and decoding AWS event stream messages. The main difference may lie in the specific implementations and additional utilities provided by each package.
3.168.0 (2022-09-09)
FAQs
[![NPM version](https://img.shields.io/npm/v/@aws-sdk/eventstream-codec/latest.svg)](https://www.npmjs.com/package/@aws-sdk/eventstream-codec) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/eventstream-codec.svg)](https://www.npmjs.com/package/@
The npm package @aws-sdk/eventstream-codec receives a total of 0 weekly downloads. As such, @aws-sdk/eventstream-codec popularity was classified as not popular.
We found that @aws-sdk/eventstream-codec demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
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.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.