
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
High-performance technical analysis library - Native + WASM backends, 158+ TA-Lib compatible indicators, works in Node.js AND Browser
High-Performance Technical Analysis Library
🚀 Native + WASM • 📊 158+ Indicators • 🌐 Node.js + Browser
| Feature | Description |
|---|---|
| 🚀 Dual Backend | Native C++ for Node.js, WebAssembly for Browser |
| 🌐 Browser Support | Full WASM support - run technical analysis in the browser! |
| 📊 158+ Indicators | Complete TA-Lib compatible indicator set |
| 🎯 100% Accurate | Validated against TA-Lib with < 1e-10 error tolerance |
| ⚡ High Performance | Native: 10-100x faster, WASM: 5-20x faster than pure JS |
| 💾 Memory Efficient | O(1) incremental updates, minimal footprint |
| 🔒 Thread Safe | Each indicator instance is independent |
| 📦 Zero Dependencies | No runtime dependencies |
npm install techkit
# or
yarn add techkit
# or
pnpm add techkit
import { init, SMA, EMA, RSI, MACD, BBANDS } from 'techkit';
// Initialize (auto-detects best backend: Native in Node.js)
await init();
// Sample price data
const prices = [44.34, 44.09, 44.15, 43.61, 44.33, 44.83, 45.10, 45.42, 45.84, 46.08];
// Create indicator instances
const sma = SMA.create(20);
const rsi = RSI.create(14);
// Calculate over array
const smaResult = sma.calculate(prices);
const rsiResult = rsi.calculate(prices);
console.log('SMA:', smaResult);
console.log('RSI:', rsiResult);
TechKit runs entirely in the browser via WebAssembly! No server required.
<!DOCTYPE html>
<html>
<head>
<title>TechKit Browser Demo</title>
</head>
<body>
<script type="module">
import { init, SMA, RSI, MACD, BBANDS } from 'https://unpkg.com/techkit/dist/browser.mjs';
// Initialize WASM backend (required in browser)
await init();
// Now use indicators just like in Node.js!
const prices = [44.34, 44.09, 44.15, 43.61, 44.33, 44.83, 45.10];
const sma = SMA.create(5);
const rsi = RSI.create(14);
console.log('SMA:', sma.calculate(prices));
console.log('RSI:', rsi.calculate(prices));
</script>
</body>
</html>
// React Component Example
import { useEffect, useState } from 'react';
import { init, SMA, RSI, MACD } from 'techkit';
function TechnicalChart({ priceData }) {
const [indicators, setIndicators] = useState(null);
const [initialized, setInitialized] = useState(false);
useEffect(() => {
// Initialize WASM on component mount
init().then(() => setInitialized(true));
}, []);
useEffect(() => {
if (!initialized || !priceData.length) return;
// Create indicators
const sma20 = SMA.create(20);
const sma50 = SMA.create(50);
const rsi = RSI.create(14);
const macd = MACD.create(12, 26, 9);
// Calculate
setIndicators({
sma20: sma20.calculate(priceData),
sma50: sma50.calculate(priceData),
rsi: rsi.calculate(priceData),
macd: macd.calculate(priceData)
});
}, [initialized, priceData]);
if (!initialized) return <div>Loading WASM...</div>;
return (
<div>
{/* Render chart with indicators */}
</div>
);
}
<template>
<div>
<div v-if="!initialized">Loading WASM...</div>
<div v-else>
<p>SMA(20): {{ sma20 }}</p>
<p>RSI(14): {{ rsi14 }}</p>
</div>
</div>
</template>
<script setup>
import { ref, onMounted, watch } from 'vue';
import { init, SMA, RSI } from 'techkit';
const props = defineProps(['prices']);
const initialized = ref(false);
const sma20 = ref([]);
const rsi14 = ref([]);
onMounted(async () => {
await init();
initialized.value = true;
});
watch([() => props.prices, initialized], ([prices, ready]) => {
if (!ready || !prices.length) return;
const smaIndicator = SMA.create(20);
const rsiIndicator = RSI.create(14);
sma20.value = smaIndicator.calculate(prices);
rsi14.value = rsiIndicator.calculate(prices);
});
</script>
import { init, SMA, EMA, RSI, MACD, BBANDS } from 'techkit';
class TradingDashboard {
private sma: any;
private rsi: any;
private macd: any;
private bbands: any;
private initialized = false;
async initialize() {
// Initialize WASM backend
await init();
// Create indicator instances (reusable!)
this.sma = SMA.create(20);
this.rsi = RSI.create(14);
this.macd = MACD.create(12, 26, 9);
this.bbands = BBANDS.create(20, 2, 2);
this.initialized = true;
console.log('TechKit WASM initialized!');
}
calculateIndicators(prices: number[]) {
if (!this.initialized) {
throw new Error('Call initialize() first!');
}
return {
sma: this.sma.calculate(prices),
rsi: this.rsi.calculate(prices),
macd: this.macd.calculate(prices),
bbands: this.bbands.calculate(prices)
};
}
// Streaming updates
onNewPrice(price: number) {
const smaResult = this.sma.update(price);
const rsiResult = this.rsi.update(price);
if (smaResult.valid) {
this.updateChart('sma', smaResult.value);
}
if (rsiResult.valid) {
this.updateChart('rsi', rsiResult.value);
}
}
private updateChart(indicator: string, value: number) {
// Update your chart library (Chart.js, Highcharts, etc.)
}
}
// Usage
const dashboard = new TradingDashboard();
await dashboard.initialize();
// Fetch price data
const prices = await fetchPrices('BTCUSD');
const indicators = dashboard.calculateIndicators(prices);
// Subscribe to real-time updates
websocket.on('price', (price) => dashboard.onNewPrice(price));
Vite (vite.config.js):
export default {
optimizeDeps: {
exclude: ['techkit'] // Let Vite handle WASM properly
},
build: {
target: 'esnext' // Required for top-level await
}
}
Webpack (webpack.config.js):
module.exports = {
experiments: {
asyncWebAssembly: true,
topLevelAwait: true
},
module: {
rules: [
{
test: /\.wasm$/,
type: 'webassembly/async'
}
]
}
};
Perfect for real-time data feeds in both Node.js and Browser:
import { init, SMA, RSI } from 'techkit';
await init();
// Create stateful indicators
const sma = SMA.create(20);
const rsi = RSI.create(14);
// WebSocket real-time feed
const ws = new WebSocket('wss://stream.example.com/prices');
ws.onmessage = (event) => {
const price = JSON.parse(event.data).price;
// O(1) incremental update - no recalculation!
const smaResult = sma.update(price);
const rsiResult = rsi.update(price);
if (smaResult.valid && rsiResult.valid) {
console.log(`SMA: ${smaResult.value.toFixed(2)}, RSI: ${rsiResult.value.toFixed(2)}`);
updateUI(smaResult.value, rsiResult.value);
}
};
| Function | Description | Parameters |
|---|---|---|
SMA | Simple Moving Average | period |
EMA | Exponential Moving Average | period |
WMA | Weighted Moving Average | period |
DEMA | Double Exponential MA | period |
TEMA | Triple Exponential MA | period |
KAMA | Kaufman Adaptive MA | period |
TRIMA | Triangular MA | period |
T3 | T3 Moving Average | period, vFactor |
| Function | Description | Parameters |
|---|---|---|
RSI | Relative Strength Index | period |
MACD | MACD | fast, slow, signal |
STOCH | Stochastic Oscillator | kPeriod, kSlow, dPeriod |
CCI | Commodity Channel Index | period |
ADX | Average Directional Index | period |
MOM | Momentum | period |
ROC | Rate of Change | period |
WILLR | Williams %R | period |
MFI | Money Flow Index | period |
APO | Absolute Price Oscillator | fast, slow |
PPO | Percentage Price Oscillator | fast, slow |
CMO | Chande Momentum Oscillator | period |
AROON | Aroon Indicator | period |
ULTOSC | Ultimate Oscillator | p1, p2, p3 |
TRIX | Triple Smooth EMA | period |
| Function | Description | Parameters |
|---|---|---|
ATR | Average True Range | period |
NATR | Normalized ATR | period |
TRANGE | True Range | - |
BBANDS | Bollinger Bands | period, nbDevUp, nbDevDn |
| Function | Description | Parameters |
|---|---|---|
OBV | On Balance Volume | - |
AD | Accumulation/Distribution | - |
ADOSC | A/D Oscillator | fast, slow |
| Function | Description | Parameters |
|---|---|---|
STDDEV | Standard Deviation | period |
VAR | Variance | period |
LINEARREG | Linear Regression | period |
LINEARREG_SLOPE | LR Slope | period |
LINEARREG_ANGLE | LR Angle | period |
CORREL | Pearson Correlation | period |
BETA | Beta Coefficient | period |
| Function | Description |
|---|---|
HT_TRENDLINE | Instantaneous Trendline |
HT_SINE | SineWave |
HT_TRENDMODE | Trend vs Cycle Mode |
HT_DCPERIOD | Dominant Cycle Period |
HT_DCPHASE | Dominant Cycle Phase |
HT_PHASOR | Phasor Components |
| Indicator | TechKit | Pure JS | Speedup |
|---|---|---|---|
| SMA(20) × 10k | 0.3ms | 12ms | 40x |
| RSI(14) × 10k | 0.5ms | 25ms | 50x |
| MACD × 10k | 0.8ms | 45ms | 56x |
| BBANDS × 10k | 0.6ms | 35ms | 58x |
| Indicator | TechKit WASM | Pure JS | Speedup |
|---|---|---|---|
| SMA(20) × 10k | 1.2ms | 12ms | 10x |
| RSI(14) × 10k | 2.0ms | 25ms | 12x |
| MACD × 10k | 3.2ms | 45ms | 14x |
| BBANDS × 10k | 2.4ms | 35ms | 15x |
Benchmarks on Chrome 120, Apple M1
Full Documentation: https://techkit-docs.netlify.app/
| Topic | Link |
|---|---|
| Installation | Getting Started |
| Quick Start | Quick Start Guide |
| Node.js API | Node.js API Reference |
| All Indicators | Indicator List |
| Examples | Code Examples |
| Changelog | Version History |
| 中文文档 | Chinese Documentation |
📖 Full API documentation: techkit-docs.netlify.app/en/api/nodejs-api/
import { init, getBackendInfo } from 'techkit';
// Initialize backend (required before using indicators)
await init();
// Check which backend is active
const info = getBackendInfo();
console.log(info);
// Node.js: { type: 'native', ready: true }
// Browser: { type: 'wasm', ready: true }
// All indicators use the factory pattern
const indicator = IndicatorName.create(param1, param2, ...);
// Calculate over array
const results = indicator.calculate(dataArray);
// Incremental update (returns { value, valid })
const result = indicator.update(newValue);
// Reset state
indicator.reset();
// Properties
indicator.lookback; // Warmup period needed
indicator.ready; // Is warmup complete?
// MACD returns 3 arrays
const macd = MACD.create(12, 26, 9);
const { macd: macdLine, signal, histogram } = macd.calculate(prices);
// Bollinger Bands returns 3 arrays
const bbands = BBANDS.create(20, 2, 2);
const { upper, middle, lower } = bbands.calculate(prices);
// Stochastic returns 2 arrays
const stoch = STOCH.create(14, 3, 3);
const { k, d } = stoch.calculate(high, low, close);
| Platform | Environment | Backend | Status |
|---|---|---|---|
| Browser | Chrome/Firefox/Safari/Edge | WASM | ✅ |
| Node.js | Windows x64 | Native | ✅ |
| Node.js | macOS x64 | Native | ✅ |
| Node.js | macOS ARM64 (M1/M2) | Native | ✅ |
| Node.js | Linux x64 | Native | ✅ |
| Deno | All platforms | WASM | ✅ |
| Bun | All platforms | Native/WASM | ✅ |
MIT License - see LICENSE for details.
Works everywhere JavaScript runs!
Node.js • Browser • Deno • Bun
Made with ❤️ by the TechKit Team
FAQs
High-performance technical analysis library - Native + WASM backends, 158+ TA-Lib compatible indicators, works in Node.js AND Browser
We found that techkit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.