#napi #javascript #nodejs #bindings #trading

nt-napi-bindings

Node.js N-API bindings for Neural Trader - High-performance TypeScript/JavaScript interface

1 stable release

1.0.0 Nov 13, 2025

#601 in Finance

MIT/Apache

160KB
3.5K SLoC

Rust 3K SLoC // 0.1% comments TypeScript 376 SLoC // 0.1% comments

Neural Trader - Node.js FFI Bindings

This crate provides high-performance Node.js bindings using napi-rs for the Neural Trader Rust core. It exposes async APIs that map directly to JavaScript Promises.

Architecture

JavaScript (Node.js)
      ↓
napi-rs (auto-generated)
      ↓
This crate (manual wrappers)
      ↓
Rust core (nt-core, nt-strategies, etc.)

Features

  • Zero-copy buffer operations for large datasets
  • Async/await with automatic Promise conversion
  • Type-safe error marshaling
  • Resource management with Arc for shared state
  • Thread-safe concurrent operations

Modules

  • broker - Broker integrations (Alpaca, IBKR, CCXT, Oanda, Questrade, Lime)
  • strategy - Trading strategy implementations
  • neural - Neural network models for forecasting
  • risk - Risk management (VaR, Kelly, drawdown)
  • backtest - Backtesting engine
  • market_data - Market data streaming and indicators
  • portfolio - Portfolio management

nt-napi-bindings

Node.js N-API bindings for Neural Trader. Provides JavaScript/TypeScript interface to Rust trading engine.

Features

  • Node.js native module
  • TypeScript type definitions
  • High-performance trading operations
  • Cross-platform support

Usage

const neuralTrader = require('nt-napi-bindings');

const trader = new neuralTrader.Trader(config);
await trader.executeTrade(order);

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Dependencies

~17–23MB
~340K SLoC