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

saurus-excel

v0.2.1

Published

πŸ¦– Blazingly fast Excel parser for the web - powered by Rust & WebAssembly

Readme

πŸ¦– Saurus-Excel

Blazingly fast Excel & CSV parser for the web - powered by Rust & WebAssembly

npm version License: MIT

Saurus-Excel is a high-performance spreadsheet parser designed for handling large datasets in the browser. Built with Rust and compiled to WebAssembly, it processes millions of rows without crashing your browser.

✨ Features

  • πŸš€ Blazingly Fast - 10x faster than SheetJS for large files
  • πŸ’Ύ Memory Efficient - Minimal RAM usage
  • πŸ“Š Multiple Formats - XLSX, XLS, XLSM, XLSB, ODS, CSV
  • βš›οΈ Framework Support - React hooks included
  • πŸ”§ TypeScript First - Full type definitions
  • πŸ“„ CSV Support - Parse CSV with custom delimiters

πŸ“¦ Installation

npm install saurus-excel

πŸš€ Usage

Vanilla JavaScript (Browser)

<!DOCTYPE html>
<html>
  <head>
    <title>Excel Parser</title>
  </head>
  <body>
    <input type="file" id="fileInput" accept=".xlsx,.xls" />
    <pre id="output"></pre>

    <script type="module">
      // Import from pkg folder for direct Wasm access
      import init, { parseExcel } from "saurus-excel/pkg/excelsaurus.js";

      // Initialize Wasm module (required once)
      await init();

      document
        .getElementById("fileInput")
        .addEventListener("change", async (e) => {
          const file = e.target.files[0];
          if (!file) return;

          // Read file as bytes
          const arrayBuffer = await file.arrayBuffer();
          const bytes = new Uint8Array(arrayBuffer);

          // Parse Excel
          const result = parseExcel(bytes, { hasHeaders: true });

          console.log(result.headers); // ["Name", "Email", "Age"]
          console.log(result.rows); // [["John", "[email protected]", 30], ...]

          document.getElementById("output").textContent = JSON.stringify(
            result,
            null,
            2,
          );
        });
    </script>
  </body>
</html>

With Bundler (Vite, Webpack, etc.)

// Note: Wasm needs special bundler config (see below)
import init, {
  parseExcel,
  getSheetNames,
} from "saurus-excel/pkg/excelsaurus.js";

// Initialize once at app startup
let initialized = false;
async function ensureInit() {
  if (!initialized) {
    await init();
    initialized = true;
  }
}

export async function parseExcelFile(file: File) {
  await ensureInit();

  const arrayBuffer = await file.arrayBuffer();
  const bytes = new Uint8Array(arrayBuffer);

  return parseExcel(bytes, {
    hasHeaders: true,
    limit: 1000, // Optional: limit rows
  });
}

βš›οΈ React 19 / Next.js (Plug & Play)

Quick Start

import { useExcelParser } from "saurus-excel/react";

function ImportPage() {
  const { parse, data, loading, error, ready } = useExcelParser();

  if (!ready) return <p>Loading parser...</p>;

  return (
    <div>
      <input
        type="file"
        accept=".xlsx,.xls"
        onChange={(e) => e.target.files?.[0] && parse(e.target.files[0])}
      />

      {loading && <p>Parsing...</p>}
      {error && <p style={{ color: "red" }}>{error.message}</p>}

      {data && (
        <table>
          <thead>
            <tr>
              {data.headers.map((h, i) => (
                <th key={i}>{h}</th>
              ))}
            </tr>
          </thead>
          <tbody>
            {data.rows.map((row, i) => (
              <tr key={i}>
                {row.map((cell, j) => (
                  <td key={j}>{cell}</td>
                ))}
              </tr>
            ))}
          </tbody>
        </table>
      )}
    </div>
  );
}

With Provider (Recommended for Next.js App Router)

// app/providers.tsx
"use client";
import { ExcelProvider } from "saurus-excel/react";

export function Providers({ children }: { children: React.ReactNode }) {
  return <ExcelProvider>{children}</ExcelProvider>;
}

// app/layout.tsx
import { Providers } from "./providers";

export default function RootLayout({ children }) {
  return (
    <html>
      <body>
        <Providers>{children}</Providers>
      </body>
    </html>
  );
}

Drop-in Component

import { ExcelDropzone } from "saurus-excel/react";

function UploadPage() {
  return (
    <ExcelDropzone
      onData={(result) => {
        console.log("Headers:", result.headers);
        console.log("Rows:", result.rows);
      }}
      onError={(err) => console.error(err)}
      options={{ hasHeaders: true, limit: 1000 }}
    />
  );
}

Available Hooks

| Hook | Description | | ------------------ | --------------------------- | | useExcelParser() | Main hook for parsing files | | useExcelSheets() | Get sheet names from file |

Hook Return Values

const {
  parse, // (file: File, options?) => Promise<ParseResult>
  data, // ParseResult | null
  loading, // boolean
  error, // Error | null
  progress, // number (0-100)
  ready, // boolean - Wasm loaded
  reset, // () => void
} = useExcelParser();

βš™οΈ Bundler Configuration

Vite

// vite.config.ts
import { defineConfig } from "vite";

export default defineConfig({
  optimizeDeps: {
    exclude: ["saurus-excel"],
  },
  build: {
    target: "esnext",
  },
});

Next.js

// next.config.js
module.exports = {
  webpack: (config) => {
    config.experiments = {
      ...config.experiments,
      asyncWebAssembly: true,
    };
    return config;
  },
};

Webpack 5

// webpack.config.js
module.exports = {
  experiments: {
    asyncWebAssembly: true,
  },
};

πŸ“– API Reference

parseExcel(bytes, options?)

Parse an Excel file from Uint8Array.

const result = parseExcel(bytes, {
  sheet: 0, // Sheet index or name (default: 0)
  limit: 1000, // Max rows to parse (default: all)
  skipRows: 0, // Rows to skip from start
  hasHeaders: true, // Treat first row as headers
});

Returns:

{
  headers: string[];           // Column headers
  rows: CellValue[][];         // Row data
  rowCount: number;            // Total rows parsed
  sheetName: string;           // Sheet name
}

getSheetNames(bytes)

Get list of sheet names in workbook.

const sheets = getSheetNames(bytes);
// ["Sheet1", "Sheet2", "Data"]

parseCsv(bytes, options?)

Parse a CSV file.

import { parseCsv } from "saurus-excel";

const result = await parseCsv(file, {
  delimiter: ",", // Delimiter character (default: ',')
  hasHeaders: true, // First row is headers
  limit: 1000, // Max rows to parse
  skipRows: 0, // Rows to skip
});

console.log(result.headers); // ["name", "email", "age"]
console.log(result.rows); // [["John", "[email protected]", 30], ...]

Supported delimiters: , (comma), ; (semicolon), \t (tab), | (pipe)

parseSpreadsheet(file, options?)

Auto-detect file type and parse (Excel or CSV).

import { parseSpreadsheet } from "saurus-excel";

// Automatically handles .xlsx, .xls, .csv files
const result = await parseSpreadsheet(file, { hasHeaders: true });

🏎 Performance

Tested with 100,000 rows:

| Metric | SheetJS | Saurus-Excel | Improvement | | ------------ | ------- | ------------ | --------------- | | Parse Time | ~15s | ~2s | 7.5x faster | | Memory Usage | ~800MB | ~100MB | 8x less | | Bundle Size | ~300KB | ~150KB | 2x smaller |


πŸ“ License

MIT Β© trietcn