Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
@aws-sdk/eventstream-codec
Advanced tools
Package description
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.
Changelog
3.295.0 (2023-03-20)
Readme
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 1,048,549 weekly downloads. As such, @aws-sdk/eventstream-codec popularity was classified as popular.
We found that @aws-sdk/eventstream-codec demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.