npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@truestroke/core

v0.1.0

Published

Behavioral biometric continuous authentication engine - zero-dependency, on-device, sub-millisecond inference via WASM + SIMD

Downloads

42

Readme

@truestroke/core

Behavioral biometric continuous authentication engine — zero-dependency, on-device, sub-millisecond inference via WebAssembly + SIMD.

TrueStroke identifies users by how they type — their unconscious keystroke rhythm. It runs entirely in-browser with sub-microsecond inference, detects account takeover the moment it happens, and never sends raw biometric data anywhere.

Installation

npm install @truestroke/core

Quick Start

import { TrueStroke } from '@truestroke/core';

// Initialize the engine
const ts = await TrueStroke.init({ userId: 'user_123' });

// Auto-capture keystrokes from any input element
ts.attachTo(document.querySelector('#my-input'));

// Or feed events manually
document.addEventListener('keydown', (e) => ts.feedKeyDown(e.code, e.timeStamp));
document.addEventListener('keyup', (e) => ts.feedKeyUp(e.code, e.timeStamp));

// Listen for anomalies (someone else typing)
ts.onAnomaly((event) => {
  console.log(`Imposter detected: confidence=${event.confidence}`);
  showReauthPrompt();
});

// Reactive status updates
ts.onConfidenceChange((c) => updateConfidenceUI(c));
ts.onStatusChange((s) => updateStatusBadge(s));

// Liveness detection
const liveness = ts.checkLiveness();
// { isLive, isReplay, entropy, jitterPower, wpm, dwellCV, score }

// Cleanup
ts.destroy();

Features

  • On-Device First — All inference runs in-browser via WebAssembly. Zero network calls. Raw typing data never leaves the device.
  • Sub-Microsecond Inference — < 1 μs p50 latency, SIMD-accelerated (WASM SIMD128).
  • 42-Dimensional Feature Vectors — Dwell time, flight time, digraphs, trigraphs, velocity, error rate, WPM, rhythm CV.
  • Dual Anomaly Detection — Isolation Forest + Adaptive Mahalanobis Distance (Ledoit-Wolf shrinkage).
  • Liveness Detection — Timing entropy, Goertzel DFT jitter, WPM bounds, replay fingerprinting.
  • Zero Dependencies — Self-contained C++17 compiled to WASM. No external libraries.
  • XChaCha20-Poly1305 — Profile data encrypted at rest.
  • GDPR-CompliantwipeProfile() for complete biometric data erasure.

API

TrueStroke.init(config)

Create and initialize an engine instance.

const ts = await TrueStroke.init({
  userId: 'user_123',
  enrollFullKeystrokes: 200,  // keystrokes for full enrollment
  lockThreshold: 0.35,        // confidence below this → lock
});

ts.attachTo(element)

Auto-capture keystrokes from an HTML input/textarea element.

ts.feedKeyDown(code, timestamp) / ts.feedKeyUp(code, timestamp)

Manual keystroke feeding for custom event handling.

ts.getConfidence()number

Current confidence score (0.0 = imposter, 1.0 = enrolled user).

ts.getStatus()Status

Current engine state: UNINITIALISED, ENROLLING, MONITORING, or LOCKED.

ts.checkLiveness()LivenessResult

Anti-spoofing check: entropy, jitter power, WPM, replay detection.

ts.onAnomaly(callback) / ts.onConfidenceChange(callback) / ts.onStatusChange(callback)

Reactive event listeners.

ts.saveProfile() / ts.wipeProfile()

Encrypted profile persistence / GDPR-compliant erasure.

ts.exportGradients() / ts.importGlobalUpdate(data)

Federated learning: export DP-noised gradients, import global model updates.

ts.destroy()

Clean up WASM resources.

Requirements

  • Browser with WebAssembly support (all modern browsers)
  • WASM SIMD128 for peak performance (Chrome 91+, Firefox 89+, Safari 16.4+)

License

MIT — Shivambu