@technoculture/safeserial 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +24 -28
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,50 +1,46 @@
1
- # @technoculture/safeserial
1
+ # SafeSerial for Node.js
2
2
 
3
- Guaranteed reliable serial communication for Node.js and Electron.
3
+ Reliable serial messaging with CRC32, fragmentation, and ACK/Retry. Built for Electron and embedded workflows where silent corruption is unacceptable.
4
4
 
5
- ## Installation
5
+ ## Install
6
6
 
7
7
  ```bash
8
8
  npm install @technoculture/safeserial
9
9
  ```
10
10
 
11
- Pre-built binaries are included for Windows and Linux (x64, arm64).
11
+ If a prebuilt binary is not available for your platform, it will build from source on install.
12
12
 
13
- ## Usage
13
+ ## Quickstart
14
14
 
15
- ```typescript
16
- import { DataBridge } from '@technoculture/safeserial';
15
+ ```ts
16
+ import { DataBridge } from "@technoculture/safeserial";
17
17
 
18
- // Open a serial port
19
- const bridge = await DataBridge.open('/dev/ttyUSB0', { baudRate: 115200 });
18
+ const bridge = await DataBridge.open("/dev/ttyUSB0", { baudRate: 115200 });
20
19
 
21
- // Receive data
22
- bridge.on('data', (data) => {
23
- console.log('Received:', data.toString());
20
+ bridge.on("data", (data) => {
21
+ console.log("Received:", data.toString());
24
22
  });
25
23
 
26
- // Send with guaranteed delivery
27
- await bridge.send('Hello, World!');
28
-
29
- // Close when done
24
+ await bridge.send("Hello, SafeSerial");
30
25
  await bridge.close();
31
26
  ```
32
27
 
33
- ## Features
28
+ ## Why SafeSerial
34
29
 
35
- - **Guaranteed Delivery** Every packet is acknowledged; lost packets are automatically retried
36
- - **Corruption Detection** — CRC32 checksum on every packet
37
- - **Large Message Support** — Automatic fragmentation and reassembly
38
- - **Electron Compatible** — Works in both main and renderer processes
30
+ - Guaranteed delivery with ACK/Retry
31
+ - CRC32 corruption detection
32
+ - Automatic fragmentation and reassembly
33
+ - Resilient reconnect support
34
+ - Electron-friendly native bindings
39
35
 
40
- ## API
36
+ ## API (Essentials)
41
37
 
42
38
  ### `DataBridge.open(port, options?)`
43
39
 
44
40
  Opens a serial port with reliable communication enabled.
45
41
 
46
- - `port` Port path (e.g., `/dev/ttyUSB0` on Linux, `COM3` on Windows)
47
- - `options.baudRate` — Baud rate (default: 115200)
42
+ - `port`: device path (e.g. `/dev/ttyUSB0`, `COM3`)
43
+ - `options.baudRate`: default `115200`
48
44
 
49
45
  Returns: `Promise<DataBridge>`
50
46
 
@@ -52,11 +48,11 @@ Returns: `Promise<DataBridge>`
52
48
 
53
49
  Sends data with guaranteed delivery.
54
50
 
55
- - `data` `Buffer` or `string` to send
51
+ - `data`: `Buffer` or `string`
56
52
 
57
- Returns: `Promise<void>` — Resolves when acknowledged
53
+ Returns: `Promise<void>`
58
54
 
59
- ### `bridge.on('data', callback)`
55
+ ### `bridge.on("data", callback)`
60
56
 
61
57
  Subscribe to received data.
62
58
 
@@ -64,7 +60,7 @@ Subscribe to received data.
64
60
 
65
61
  Closes the serial port.
66
62
 
67
- ## Building from Source
63
+ ## Build From Source
68
64
 
69
65
  ```bash
70
66
  cd bindings/node
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@technoculture/safeserial",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Guaranteed reliable serial communication for Node.js and Electron",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",