Start in minutes
Install, create, serialize, and receive a message.
Get started →3.0.0 · normalize once · cross every boundary
Create a predictable { type, data } envelope, serialize it to JSON, and load it again in Node.js, browsers, WebSockets, IPC, workers, or any JavaScript host.
import Message from 'js-message';
const message = new Message();
message.type = 'user.updated';
message.data = {
id: 42,
active: true
};
socket.send(message.JSON);
Choose the page you need
Each topic has a focused page, so implementation details stay close and navigation stays fast.
Install, create, serialize, and receive a message.
Get started →See every field, method, return value, and failure mode.
Open the API →Understand valid envelopes, ignored extras, and error recovery.
Read the contract →Review vanilla-test coverage, compatibility, and package checks.
Inspect testing →Install
The public module uses only JavaScript and native JSON behavior. Version 3.0.0 is published on npm with zero runtime dependencies.
npm install js-message