otter-node

Crates.iootter-node
lib.rsotter-node
version0.1.3
created_at2026-01-15 12:38:25.866547+00
updated_at2026-01-16 06:42:51.850751+00
descriptionNode.js API layer for Otter
homepagehttps://github.com/octofhir/otter
repositoryhttps://github.com/octofhir/otter
max_upload_size
id2045480
size347,485
Alexander Streltsov (octoshikari)

documentation

README

otter-node

Node.js API compatibility layer for Otter.

Overview

otter-node provides Node.js-compatible APIs for the Otter runtime, enabling existing Node.js code to run with minimal modifications.

Supported APIs

  • path - Path manipulation utilities
  • buffer - Binary data handling
  • fs - File system operations
  • crypto - Cryptographic operations (randomBytes, createHash, etc.)
  • stream - Web Streams API (ReadableStream, WritableStream)
  • websocket - WebSocket client
  • worker - Web Worker API
  • test - Test runner (describe, it, assert)

Usage

Add to your Cargo.toml:

[dependencies]
otter-node = "0.1"

Example

use otter_node::path;
use otter_node::buffer::Buffer;

// Path manipulation
let joined = path::join(&["foo", "bar", "baz.txt"]);
assert_eq!(joined, "foo/bar/baz.txt");

// Buffer operations
let buf = Buffer::from_string("hello", "utf8").unwrap();
assert_eq!(buf.to_string("base64", 0, buf.len()), "aGVsbG8=");

License

MIT

Commit count: 0

cargo fmt