Skip to content

gurezo/web-serial-rxjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

321 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

web-serial-rxjs

web-serial-rxjs project icon

A TypeScript library that provides a reactive RxJS-based wrapper for the Web Serial API, enabling easy serial port communication in web applications.

Table of Contents

Features

  • RxJS-based reactive API: Leverage the power of RxJS Observables for reactive serial port communication
  • TypeScript support: Full TypeScript type definitions included
  • Browser detection: Built-in browser support detection and error handling
  • Error handling: Comprehensive error handling with custom error classes and error codes
  • Framework agnostic: Works with any JavaScript/TypeScript framework or vanilla JavaScript

Framework Support

This library is framework-agnostic and can be used with:

  • Angular
  • React
  • Svelte
  • Vanilla JavaScript / TypeScript

Browser Support

The Web Serial API is currently only supported in Chromium-based browsers:

  • Chrome 89+
  • Edge 89+
  • Opera 75+

The library includes built-in browser detection utilities to check for Web Serial API support before attempting to use it.

Installation

Install the package using npm or pnpm:

npm install @gurezo/web-serial-rxjs
# or
pnpm add @gurezo/web-serial-rxjs

Peer Dependencies

This library requires RxJS as a peer dependency:

npm install rxjs
# or
pnpm add rxjs

Minimum required version: RxJS ^7.8.0

Documentation

  • Quick Start - Get started with basic examples and usage patterns
  • API Reference - Complete API documentation with detailed descriptions
  • Advanced Usage - Advanced patterns, stream processing, and error recovery

Examples

Examples are available for the following environments:

  • Angular - Angular example using a Service
  • React - React example with custom hook (useSerialClient)
  • Svelte - Svelte example using Svelte Store
  • Vanilla JavaScript - Basic usage with vanilla JavaScript
  • Vanilla TypeScript - TypeScript example with RxJS
  • Vue - Vue 3 example using Composition API

Each example includes a README with setup and usage instructions.

Project Icon

The project icon includes a modified design inspired by the RxJS logo, combined with a serial connector motif to represent Web Serial communication.

The icon is used only to indicate that this library provides RxJS-based abstractions for the Web Serial API.

This project is an independent open source project and is not affiliated with, endorsed by, or sponsored by the ReactiveX or RxJS project.

AI Assistant (MCP)

This project includes Model Context Protocol (MCP) server configuration for AI-assisted development. The following MCP servers are available:

Server Purpose
nx-mcp Nx workspace analysis, project graph, CI monitoring, and documentation
angular-cli Angular CLI tools for example-angular (code generation, documentation, best practices)
svelte Svelte/SvelteKit documentation and code analysis for example-svelte

Configuration files:

  • .mcp.json - Standard MCP configuration (Cursor, VS Code, Claude, etc.)
  • .cursor/mcp.json - Cursor-specific configuration

To use MCP servers in Cursor, the configuration is automatically loaded from .cursor/mcp.json. For VS Code, add the MCP extension and configure it to use .mcp.json, or add the server definitions to your MCP settings.

Development and Release Strategy

This project follows a trunk-based development approach:

  • main branch: Always in a release-ready state
  • Short-lived branches: feature/*, fix/*, docs/* for pull requests
  • Releases: Managed via Git tags (e.g., v1.0.0), not branches
  • Version maintenance: release/v* branches are added only when needed for maintaining multiple major versions

For detailed contribution guidelines, see CONTRIBUTING.md.

For detailed release instructions, see RELEASING.md.

Contributing

We welcome contributions! Please see our Contributing Guide for details on:

  • Development setup
  • Code style guidelines
  • Commit message conventions
  • Pull request process
  • Release process

For Japanese contributors, please see CONTRIBUTING.ja.md.

For release instructions, see RELEASING.md (or RELEASING.ja.md for Japanese).

License

This project is licensed under the MIT License - see the LICENSE file for details.

Links