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 🙏

© 2025 – Pkg Stats / Ryan Hefner

tinyframejs

v1.0.4

Published

Lightweight, high-performance tabular data engine for JavaScript

Downloads

34

Readme

TinyFrameJS

TinyFrameJS constitutes an advanced, high-performance JavaScript framework tailored for processing large-scale tabular and financial data. Architected atop a bespoke in-memory representation inspired by columnar data paradigms (such as Pandas), TinyFrameJS is rigorously optimized for the JavaScript runtime ecosystem.

It leverages TypedArray-based memory management to enable low-latency, high-throughput operations, offering computational efficiency approaching that of systems implemented in native code, but with the accessibility and flexibility of JavaScript.


🚀 Mission Statement

TinyFrameJS endeavors to establish a scalable, memory-efficient, and performant infrastructure for analytical and quantitative workflows in JavaScript. It obviates the need to offload workloads to Python or R by providing a native, fluent API for statistical computation, data transformation, and time-series modeling directly within the JS execution environment (Node.js or browser).


🔥 Core Differentiators

  • Entirely JavaScript-native with zero binary dependencies (no WebAssembly or C++ bindings required)
  • Operates directly on Float64Array and Int32Array structures to ensure dense memory layout and consistent type uniformity
  • Achieves 10× to 100× performance gains over traditional JS object/array workflows
  • DataFrame prototype is auto-extended at runtime; no manual augmentation or external registration required
  • Modular design enables method-level tree-shaking for highly customized builds

Released under the MIT license, ensuring unrestricted academic and commercial application.


📊 Benchmark Results (vs competitors)

| Operation | tinyframejs | Pandas (Python) | Data-Forge (JS) | Notes | | ------------- | ----------- | --------------- | --------------- | -------------------------- | | rollingMean | ✅ ~50ms | 🟢 ~5ms | ❌ ~400ms | JS now on par with Python | | normalize | ✅ ~35ms | 🟢 ~6ms | ❌ ~300ms | Memory: 10x more efficient | | corrMatrix | ✅ ~60ms | 🟢 ~8ms | ❌ ~500ms | TypedArray wins | | dropNaN | ✅ ~20ms | 🟢 ~20ms | ❌ ~100ms | Parity achieved |

All results measured on 100,000 rows × 10 columns. See benchmark_tiny.js for test script.


📦 Project Structure Overview

src/
├── core/                # Foundational logic: validators, type guards, runtime enforcement
├── io/                  # Input/output abstraction layer: CSV, XLSX, JSON, SQL, APIs
├── methods/             # Modular operations: aggregation, filtering, sorting, transforms, rolling
│   ├── aggregation/
│   ├── filtering/
│   ├── sorting/
│   ├── transform/
│   ├── rolling/
│   ├── raw.js           # Unified export of method definitions
│   ├── inject.js        # Dependency injection wrapper for stateful functions
│   └── autoExtend.js    # Runtime auto-extension of DataFrame.prototype
├── frame/               # TinyFrame core representation + DataFrame chainable API class
├── display/             # Rendering modules for console and web visualization
├── utils/               # Low-level array, math, and hashing utilities
├── loader.js            # Global pre-initialization logic (invokes auto-extension)
├── types.js             # Global TS type definitions
└── index.js             # Public API surface of the library

🧠 Architecture Design

Data Flow Pipeline

TinyFrameJS follows a clear data flow from raw inputs to the fluent API:

graph TD
    input[Raw Data: CSV, JSON, API] --> reader[reader.js]
    reader --> createFrame[createFrame.js]
    createFrame --> tf[TinyFrame Structure]
    tf --> df[DataFrame Wrapper]
    df --> auto[Auto-Extended Methods]
    auto --> user["User API: df.sort().dropNaN().head().count()"]

Auto-Extension Mechanism

One of TinyFrameJS's key innovations is its automatic method extension:

  1. All methods are defined as pure, curried functions with dependency injection
  2. The inject.js module centralizes dependencies like validators
  3. The autoExtend.js module automatically attaches all methods to DataFrame.prototype
  4. This happens once at runtime initialization

This approach provides several benefits:

  • Zero boilerplate: No manual registration of methods
  • Tree-shakable: Unused methods can be eliminated by bundlers
  • Fluent API: Methods can be chained naturally
  • Clean separation: Core logic vs. API surface

Method Types

TinyFrameJS methods fall into two categories:

  1. Transformation methods (e.g., sort(), dropNaN(), head())

    • Return a new DataFrame instance
    • Can be chained with other methods
  2. Aggregation methods (e.g., count(), mean(), sum())

    • Return a scalar value or array
    • Typically terminate a method chain

Example of combined usage:

// Chain transformations and end with aggregation
const result = df
  .sort('price') // transformation → returns new DataFrame
  .dropNaN('volume') // transformation → returns new DataFrame
  .head(10) // transformation → returns new DataFrame
  .mean('price'); // aggregation → returns number

🧠 API Design Paradigm

Instantiation

import { DataFrame } from 'tinyframejs';

const df = new DataFrame({
  date: ['2023-01-01', '2023-01-02'],
  price: [100, 105],
  volume: [1000, 1500],
});

Declarative Transformation Pipeline

const top10 = df.sort('price').dropNaN('price').head(10).count('price');

Core methods include:

  • Row-wise transformations: dropNaN, fillNaN, head, sort, diff, cumsum
  • Aggregations: count, mean, sum, min, max
  • Rolling statistics: rollingMean, rollingStd, etc.

All methods are automatically attached via runtime bootstrap — no explicit extension required.

Grouped Aggregation

const grouped = df.groupBy(['sector']).aggregate({
  price: 'mean',
  volume: 'sum',
});

Reshape Operations

df.pivot('date', 'symbol', 'price');
df.melt(['date'], ['price', 'volume']);

Additional idioms and usage scenarios available in examples/.


🚀 Future Enhancements

TinyFrameJS roadmap includes several performance-focused enhancements:

StreamingFrame

For processing massive datasets that don't fit in memory:

  • Chunk-based processing of large files
  • Streaming API for continuous data ingestion
  • Memory-efficient operations on datasets with 10M+ rows

LazyPipeline

For optimized execution of complex transformations:

  • Deferred execution until results are needed
  • Automatic operation fusion and optimization
  • Reduced intermediate allocations

Memory Optimization

  • Batch mutations to reduce allocations
  • Improved encapsulation of internal structures
  • Optimized cloning strategies for transformations

🛠 Development Workflow

npm run lint        # Lint codebase with ESLint
npm run build       # Compile into dist/
npm run test        # Execute unit tests (Vitest)
npm run benchmark   # Launch performance suite

CI/CD is automated via GitHub Actions + Changesets. See ci.yml.


🛣 Roadmap

  • [x] Fully declarative DataFrame interface
  • [x] TypedArray-powered core computation
  • [x] Auto-attached methods via runtime extension
  • [x] Competitive performance with compiled backends
  • [ ] Expand statistical/transform methods and rolling ops
  • [ ] StreamingFrame: chunk-wise ingestion for massive datasets
  • [ ] Lazy evaluation framework: .pipe() + deferred execution
  • [ ] WebAssembly integration for CPU-bound operations
  • [ ] Documentation with real-time interactive notebooks

🤝 Contributing Guidelines

  • Fork → Feature Branch → Pull Request
  • Adopt Conventional Commits (e.g., feat:, fix:, docs:)
  • Ensure all changes pass lint, test, and CI gates

Refer to CONTRIBUTING.md for detailed guidelines.


🧑‍💻 Developer

Made with ❤️ by @a3ka


🌟 Support the Project

If you like what we're building, please consider:

  • ⭐️ Starring this repository
  • 🐦 Sharing on Twitter / Reddit
  • 👨‍💻 Submitting a PR
  • 💬 Giving feedback in Discussions

Together we can bring efficient data tools to the web.


📜 License

MIT © TinyFrameJS authors. Use freely. Build boldly.