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

@nuptechs/nup-xlsx-core

v0.1.1

Published

Lightweight, Edge-compatible Excel parser with full style resolution

Readme

@aspect/nup-xlsx-core

Lightweight, Edge-compatible Excel (.xlsx) and CSV parser with full style resolution including theme colors.

Features

  • Edge-Compatible: Zero Node.js dependencies, works in Cloudflare Workers, Vercel Edge, and browsers
  • Small Bundle: ~6KB gzipped (uses only fflate for ZIP handling)
  • Full Style Resolution: Theme colors, indexed colors, and tint calculations
  • TypeScript: 100% TypeScript with full type definitions
  • Tree-shakeable: Named exports with no side effects

Installation

npm install @aspect/nup-xlsx-core

Usage

Parse XLSX

import { parseXlsx } from '@aspect/nup-xlsx-core';

const response = await fetch('spreadsheet.xlsx');
const buffer = await response.arrayBuffer();
const workbook = await parseXlsx(buffer);

for (const sheet of workbook.sheets) {
  console.log(`Sheet: ${sheet.name}`);
  for (const row of sheet.cells) {
    for (const cell of row) {
      console.log(cell.value, cell.style);
    }
  }
}

Parse CSV

import { parseCsv } from '@aspect/nup-xlsx-core';

const csvText = 'Name,Age\nAlice,30\nBob,25';
const sheet = parseCsv(csvText);

console.log(sheet.cells[0][0].value); // "Name"
console.log(sheet.cells[1][1].value); // 30

Color Resolution

import { resolveColor, getDefaultTheme } from '@aspect/nup-xlsx-core';

const theme = getDefaultTheme();

// Resolve theme color
const color = resolveColor({ theme: 4, tint: 0.5 }, theme);
console.log(color); // "#A7BFDD" (lightened accent1)

Cell Reference Utilities

import { cellRefToCoords, coordsToCellRef } from '@aspect/nup-xlsx-core';

cellRefToCoords('B4'); // { row: 3, col: 1 }
coordsToCellRef({ row: 3, col: 1 }); // "B4"

API

Main Functions

  • parseXlsx(data: ArrayBuffer | Uint8Array): Promise<NupWorkbook> - Parse XLSX file
  • parseCsv(text: string, options?: CsvOptions): NupWorksheet - Parse CSV text

Color Functions

  • resolveColor(color: ColorSpec, theme: NupTheme): string - Resolve any color to #RRGGBB
  • getDefaultTheme(): NupTheme - Get default Office theme
  • applyTint(hexColor: string, tint: number): string - Apply tint to a color
  • getIndexedColor(index: number): string - Get indexed palette color

Utility Functions

  • cellRefToCoords(ref: string): CellRef - Convert "B4" to {row: 3, col: 1}
  • coordsToCellRef(coords: CellRef): string - Convert {row: 3, col: 1} to "B4"

Types

interface NupWorkbook {
  name: string;
  sheets: NupWorksheet[];
  theme: NupTheme;
  metadata?: { creator?: string; created?: Date; modified?: Date };
}

interface NupWorksheet {
  name: string;
  cells: NupCell[][];
  columns: ColumnInfo[];
  rows: RowInfo[];
  merges: MergeRange[];
  frozen?: FreezePane;
}

interface NupCell {
  value: string | number | boolean | Date | null;
  formula?: string;
  style: NupCellStyle;
  type: 'string' | 'number' | 'boolean' | 'date' | 'formula' | 'empty';
}

interface NupCellStyle {
  font?: FontStyle;
  fill?: FillStyle;
  border?: BorderStyle;
  alignment?: AlignmentStyle;
  numberFormat?: string;
}

License

MIT