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

@velo-sci/sci-math-wasm

v1.0.5

Published

High-performance scientific mathematical functions for WebAssembly

Readme

sci-math-wasm 🧪

High-performance scientific mathematical functions for the web, powered by Rust and WebAssembly.

Overview

sci-math-wasm provides a robust, typed, and highly optimized set of mathematical tools designed specifically for scientific applications, data analysis, and signal processing in browser environments.

Features

  • 🚀 Performance: Hand-optimized Rust algorithms compiled to WASM.
  • 📈 Analysis: Regression, Calculus, and Signal Processing (FFT).
  • 📊 Statistics: Mean, median, variance, standard deviation.
  • 🔢 Linear Algebra: Vector and Matrix operations.
  • 📁 File I/O: Scientific data parsing (CSV, Excel, DAT, MPT) with auto-detection.
  • 📐 Math Tools: Complex numbers, Polynomials, and Trigonometry.
  • 📚 Documentation: Full VitePress site with LaTeX support.

Documentation

Full documentation is available at https://velosci.github.io/sci-math-wasm/ (locally in /docs).

Interactive benchmarks comparing WASM vs JavaScript performance for both mathematical computations and file processing are available at the /bench route.

Installation

npm install sci-math-wasm
# or
pnpm add sci-math-wasm

Usage

import init, { mean, fft, magnitude, TextStreamer, sniffFormat } from 'sci-math-wasm';

async function run() {
    await init();
    
    // === Mathematical Operations ===
    const data = new Float64Array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]);
    
    // Statistics
    const avg = mean(data);
    console.log(`Mean: ${avg}`);
    
    // Signal Processing
    const spectrum = fft(data);
    const mags = magnitude(spectrum);
    console.log('Frequencies:', mags);
    
    // === File Processing ===
    // Auto-detect file format
    const fileHeader = new Uint8Array(await file.slice(0, 2048).arrayBuffer());
    const hint = sniffFormat(fileHeader);
    
    if (!hint.isBinary) {
        // Process text-based scientific files
        const streamer = new TextStreamer()
            .setDelimiter(hint.delimiter)
            .setSkipLines(hint.skipLines)
            .setCommentChar(hint.commentChar);
        
        // Stream processing for large files
        const reader = file.stream().getReader();
        while (true) {
            const { done, value } = await reader.read();
            if (done) break;
            const rows = streamer.processChunk(value);
            // Process rows incrementally
        }
    }
}

run();

Modules

  • basic: Fundamental arithmetic and utilities.
  • stats: Statistical analysis tools.
  • linalg: Linear algebra (Vectors & Matrices).
  • signal: Advanced signal processing (FFT).
  • io: Scientific file parsing (CSV, Excel, DAT, MPT) with auto-detection.

Development

Build

Requires rust and wasm-pack.

wasm-pack build --target web

Documentation

cargo doc --open

License

MIT © VeloSci