Files
wickra/bindings/node
kingchenc 5c40acd288 ci+loader: build with --platform; ship napi-generated loader
The Windows Node 18 and Node 20 CI jobs failed because:

- ci.yml ran 'napi build --release' (no --platform), which produces a
  filename without the target triple ('wickra.node').
- The committed loader at bindings/node/index.js looked for the
  triple-suffixed file ('wickra.win32-x64-msvc.node') and then for the
  per-platform npm subpackage as a fallback.
- 'wickra-win32-x64-msvc' isn't on npm yet (blocked by the spam filter),
  so Windows had nothing to load. Linux and macOS passed only because
  their optionalDependencies do exist on npm and got fetched.

Two-part fix:

- ci.yml now runs 'napi build --platform --release', matching release.yml.
  --platform encodes the target triple in the filename, so the loader's
  primary lookup always finds the freshly built binary on every host.

- bindings/node/index.js is now the canonical napi-rs auto-generated
  loader (it gets regenerated by 'napi build'). It covers all the platforms
  napi knows about (linux glibc/musl, Android, FreeBSD, ARM, etc.) rather
  than just the four we publish, so unsupported platforms get a clear
  'this binding isn't built for your system' error instead of a confusing
  ENOENT.

Local sanity: 'npx napi build --platform --release' then 'node --test
__tests__/' succeeds end to end on Windows; the eight existing tests
pass.
2026-05-21 21:53:49 +02:00
..

@wickra/wickra

Node.js bindings for the Wickra streaming-first technical indicators library.

Install

Once published, install per platform via the precompiled native package:

npm install @wickra/wickra

Build from source

cd bindings/node
npm install
npm run build
npm test

The native module is built via napi-rs. The build script produces a wickra.<platform>-<arch>.node binary in the package root that index.js loads at runtime.

Usage

import { SMA, RSI, MACD, version } from '@wickra/wickra';

console.log('wickra', version());

// Batch:
const prices = Array.from({ length: 1000 }, (_, i) => 100 + Math.sin(i * 0.1) * 5);
const rsi = new RSI(14).batch(prices);

// Streaming:
const macd = new MACD(12, 26, 9);
for (const p of livePriceStream) {
  const v = macd.update(p);
  if (v && v.histogram > 0) console.log('bullish crossover candidate');
}

See index.d.ts for the full TypeScript surface.