react-native-signal-scorer-lite
v0.1.0
Published
Lightweight signal scoring for React Native - pure C++ Nitro module with TS fallback
Maintainers
Readme
react-native-signal-scorer-lite
A lightweight signal-scoring Nitro module for React Native. It inspects a numeric window of time-series samples and returns trend direction, volatility, confidence, and a composite score — without any Rust dependency. The algorithm lives directly in C++ (with a pure-TS fallback), so it is simple to build and easy to reason about.
What it does
Given a numeric signal array, it returns:
mean— average valueslope— trend directionvolatility— standard deviationscore— composite in[0, 1]confidence— in[0, 1]prediction—steady,accelerating, orvolatile
Differences from the full signal-scorer
- No Rust — the scoring math is implemented directly in C++ (
cpp/HybridSignalScorerLite.cpp). - No JNI bridge — only the Nitro HybridObject path is provided.
- No named registry — stateless, so there is no
reset()method. - Same public API —
evaluate,score,evaluateBatch, andscoreSignal.
Architecture
TypeScript (spec) -> C++ HybridObject (algorithm inlined)
-> TS fallback (when native unavailable)Getting started
npm install
npm run typecheckAPI
import { signalScorerLite, scoreSignal } from 'react-native-signal-scorer-lite'
const result = signalScorerLite.score([0.2, 0.5, 0.7, 1.1, 1.3])
// { prediction: 'accelerating', confidence: 0.8, score: 0.85, slope: 0.275, volatility: 0.4, mean: 0.76 }
const batch = signalScorerLite.evaluateBatch([0.2, 0.5, 0.7, 1.1, 1.3], 3)
// Array<SignalPrediction>