4 releases

Uses new Rust 2024

0.1.3 Jan 16, 2026
0.1.2 Jan 15, 2026
0.1.1 Jan 15, 2026
0.1.0 Jan 15, 2026

#2002 in Development tools


Used in otterjs

MIT license

525KB
12K SLoC

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

Dependencies

~45–86MB
~1.5M SLoC