Security News
pnpm 9.5 Introduces Catalogs: Shareable Dependency Version Specifiers
pnpm 9.5 introduces a Catalogs feature, enabling shareable dependency version specifiers, reducing merge conflicts and improving support for monorepos.
@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.310.0 (2023-04-10)
Readme
FAQs
Unknown package
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.
Security News
pnpm 9.5 introduces a Catalogs feature, enabling shareable dependency version specifiers, reducing merge conflicts and improving support for monorepos.
Security News
A threat actor on BreachForums is selling an unverified npm vulnerability for account takeover, but npm has not officially confirmed the existence of this security concern.
Security News
Cyber insurance rates are dropping as the market matures, according to a new report projecting global premiums to reach $43 billion by 2030, driven by international market uptake and growth in the SME sector.