This commit is contained in:
2026-03-06 08:19:15 +07:00
parent 1b86a9252d
commit aa7cdbd36f
31 changed files with 89 additions and 89 deletions

View File

@@ -82,7 +82,7 @@ env = smartreceive(msg; fileserver_download_handler=_fetch_with_backoff)
**JavaScript:**
```javascript
const NATSBridge = require('natbridge');
const NATSBridge = require('natsbridge');
// Send
const [env, env_json_str] = await NATSBridge.smartsend(
@@ -104,7 +104,7 @@ const env = await NATSBridge.smartreceive(msg, {
**Python:**
```python
from natbridge import NATSBridge
from natsbridge import NATSBridge
# Send
env, env_json_str = NATSBridge.smartsend(
@@ -124,7 +124,7 @@ env = NATSBridge.smartreceive(
**MicroPython:**
```python
from natbridge import NATSBridge
from natsbridge import NATSBridge
# Send (limited to direct transport due to memory constraints)
env, env_json_str = NATSBridge.smartsend(

View File

@@ -16,9 +16,9 @@ This document describes the implementation of the high-performance, bi-direction
| Language | Implementation File | Description |
|----------|---------------------|-------------|
| **Julia** | [`src/NATSBridge.jl`](../src/NATSBridge.jl) | Full Julia implementation with Arrow IPC support |
| **JavaScript** | `src/natbridge.js` | Node.js/browser implementation |
| **Python** | `src/natbridge.py` | Desktop Python implementation |
| **MicroPython** | `src/natbridge_mpy.py` | MicroPython implementation (limited features) |
| **JavaScript** | `src/natsbridge.js` | Node.js/browser implementation |
| **Python** | `src/natsbridge.py` | Desktop Python implementation |
| **MicroPython** | `src/natsbridge_mpy.py` | MicroPython implementation (limited features) |
---
@@ -228,7 +228,7 @@ end
#### JavaScript
```javascript
const NATSBridge = require('natbridge');
const NATSBridge = require('natsbridge');
// Single payload
const [env, env_json_str] = await NATSBridge.smartsend(
@@ -275,7 +275,7 @@ for (const [dataname, data, type] of env.payloads) {
#### Python
```python
from natbridge import NATSBridge
from natsbridge import NATSBridge
# Single payload
env, env_json_str = await NATSBridge.smartsend(
@@ -317,7 +317,7 @@ for dataname, data, type_ in env["payloads"]:
#### MicroPython
```python
from natbridge import NATSBridge
from natsbridge import NATSBridge
# Limited to text and binary (no tables due to memory constraints)
env, env_json_str = NATSBridge.smartsend(
@@ -929,7 +929,7 @@ end
#### Module Structure
```javascript
// natbridge.js
// natsbridge.js
const nats = require('nats');
const { v4: uuidv4 } = require('uuid');
const fetch = require('node-fetch');
@@ -1272,7 +1272,7 @@ async function plikOneshotUpload(file_server_url, dataname, data) {
#### Module Structure
```python
# natbridge.py
# natsbridge.py
import asyncio
import base64
import json
@@ -1690,7 +1690,7 @@ MicroPython has significant constraints compared to desktop implementations:
### MicroPython Module Structure
```python
# natbridge_mpy.py (MicroPython)
# natsbridge_mpy.py (MicroPython)
import network
import time
import json