Skip to content

lenkan/cesr-js

Repository files navigation

CESR-JS

NPM Version NPM License CI codecov Documentation

A JavaScript/TypeScript implementation of Composable Event Stream Representation (CESR) for parsing and processing cryptographic event streams.

⚠️ Work in Progress: This package is currently under development and not intended for production use.

📖 Documentation

🚀 Installation

npm install cesr

📋 Usage

Install using npm

npm install cesr

Basic Example

Parse a CESR stream from a URL:

import { parse } from "cesr";

const url = new URL("/lenkan/cesr-js/refs/heads/main/fixtures/geda.cesr", "https://raw.githubusercontent.com");
const response = await fetch(url);

if (response.body) {
  for await (const message of parse(response.body)) {
    console.log(message);
  }
}

🖥️ Command Line Interface

Install globally to use the CLI:

npm install -g cesr

CLI Usage

# Show help
cesr --help

# Parse a CESR file from a URL
cesr https://raw.githubusercontent.com/lenkan/cesr-js/refs/heads/main/fixtures/geda.cesr

# Parse from stdin with pretty printing
curl https://example.com/stream.cesr | cesr --pretty -

# Parse a local file
cesr ./path/to/file.cesr

✨ Features

  • CESR Frame Parsing - Complete support for CESR primitive parsing
  • JSON Messages - Parse embedded JSON messages in streams
  • Streaming Support - Process data incrementally as it arrives
  • TypeScript Support - Full type definitions included
  • Command Line Tool - Parse CESR streams from command line
  • MSGPACK Messages - Coming soon
  • CBOR Messages - Coming soon
  • 🔧 Encoding/Decoding API - Available from cesr/__unstable__ (experimental)

🤝 Contributing

This project is open source and contributions are welcome! Please feel free to:

  • Report bugs or issues
  • Suggest new features

📄 License

This project is licensed under the terms specified in the LICENSE file.

About

No description, website, or topics provided.

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors