Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
@aws-sdk/eventstream-serde-browser
Advanced tools
[![NPM version](https://img.shields.io/npm/v/@aws-sdk/eventstream-serde-browser/latest.svg)](https://www.npmjs.com/package/@aws-sdk/eventstream-serde-browser) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/eventstream-serde-browser.svg)](https:/
@aws-sdk/eventstream-serde-browser is a package within the AWS SDK for JavaScript that provides serialization and deserialization of event streams in a browser environment. This is particularly useful for handling AWS services that use event streams, such as AWS Transcribe or AWS Kinesis.
Serialization of Event Streams
This feature allows you to serialize an event stream into a format that can be transmitted over the network. The code sample demonstrates how to create an EventStreamMarshaller and use it to serialize an event.
const { EventStreamMarshaller } = require('@aws-sdk/eventstream-serde-browser');
const marshaller = new EventStreamMarshaller(utf8Encoder, utf8Decoder);
const event = { eventType: 'example', data: 'sample data' };
const serializedEvent = marshaller.marshall(event);
console.log(serializedEvent);
Deserialization of Event Streams
This feature allows you to deserialize an event stream received over the network back into a JavaScript object. The code sample demonstrates how to create an EventStreamMarshaller and use it to deserialize a binary event stream.
const { EventStreamMarshaller } = require('@aws-sdk/eventstream-serde-browser');
const marshaller = new EventStreamMarshaller(utf8Encoder, utf8Decoder);
const serializedEvent = new Uint8Array([/* some binary data */]);
const event = marshaller.unmarshall(serializedEvent);
console.log(event);
The 'eventsource' package is a polyfill for the EventSource API, which allows you to receive server-sent events in a browser environment. While it does not provide serialization and deserialization of event streams, it is useful for handling real-time data streams from a server.
The 'kinesis-client' package is a client library for AWS Kinesis, which provides functionalities for consuming and processing data streams. It includes features for handling event streams but is more focused on Kinesis-specific use cases compared to the general-purpose event stream serialization/deserialization provided by @aws-sdk/eventstream-serde-browser.
An internal package
You probably shouldn't, at least directly.
FAQs
[![NPM version](https://img.shields.io/npm/v/@aws-sdk/eventstream-serde-browser/latest.svg)](https://www.npmjs.com/package/@aws-sdk/eventstream-serde-browser) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/eventstream-serde-browser.svg)](https:/
The npm package @aws-sdk/eventstream-serde-browser receives a total of 1,124,955 weekly downloads. As such, @aws-sdk/eventstream-serde-browser popularity was classified as popular.
We found that @aws-sdk/eventstream-serde-browser 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.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.