JSPM

molniya

0.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q36502F
  • License MIT

A simply typed DataFrame library with zero dependencies that honors your memory.

Package Exports

  • molniya

Readme

Molniya Logo

Molniya

A simply typed DataFrame library with zero dependencies that honors your memory.

DocumentationCookbookExamples


What is Molniya?

Molniya is a DataFrame library built specifically for Bun. It helps you load, transform, and analyze structured data without the complexity of heavy frameworks.

Think Pandas for Python, but designed for TypeScript and Bun from the ground up.

Install

bun add molniya

Quick Start

Simple and clean - operations throw errors when they fail:

import { fromArrays, filter, select } from "molniya";

const df = fromArrays({
  name: ["Alice", "Bob", "Charlie"],
  age: [25, 30, 35],
  city: ["NYC", "LA", "Chicago"],
});

// Throws if error occurs - no Result unwrapping needed
const adults = filter(df, "age", ">=", 30);
const result = select(adults, ["name", "city"]);

console.log(result.toString());

Error handling: Wrap in try/catch when you need to handle errors:

try {
  const df = fromArrays({ ... });
  const filtered = filter(df, "age", ">=", 30);
} catch (error) {
  console.error("Operation failed:", error);
}

Type inference: TypeScript infers schema types automatically:

const df = fromArrays({
  name: ["Alice"], // Type: DataFrame<{ name: "string", age: "float64" }>
  age: [25],
});

Why Molniya?

  1. Schema-first design
    Define your data types once, get type safety and optimizations everywhere.

  2. Built for Bun
    Uses Bun's file I/O and SIMD capabilities. No polyfills, and unfortunately no Node.js compatibility layers.

  3. Zero dependencies
    The entire library has zero runtime dependencies. Install with confidence.

  4. Clean error handling
    Operations throw errors when they fail - simple and predictable. Wrap in try/catch when needed.

LazyFrame for Large Files

For big datasets, use LazyFrame for automatic query optimization:

import { LazyFrame, DType } from "molniya";

const schema = {
  product: DType.String,
  category: DType.String,
  revenue: DType.Float64,
};

const result = await LazyFrame.scanCsv("sales.csv", schema)
  .filter("category", "==", "Electronics") // Pushed down to scan
  .filter("revenue", ">", 1000)
  .select(["product", "revenue"]) // Only load these columns
  .collect(); // Execute optimized plan

LazyFrame analyzes your query and:

  • Predicate pushdown - Filters during CSV parsing
  • Column pruning - Only reads needed columns
  • Query fusion - Combines operations when possible

Real impact: For a 1GB CSV file, this can mean reading only 100MB.

Learn More

New to Molniya?

Ready to build?

Need details?

Community

License

MIT License. See LICENSE for details.