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

wasm-xlsx-parser

v0.2.0

Published

wasm xlsx file format parser

Readme

wasm-xlsx-parser

WebAssembly XLSX文件格式分析器

WebAssembly xlsx file format parser

Installation

yarn add wasm-xlsx-parser

Usage

import * as wasm from "wasm-xlsx-parser";

// 需要使用try{}catch (e){} 捕获错误
const xlsxTrait = new wasm.XlsxTrait(uint8Array);

// 获取所有sheet名称
const sheets  = xlsxTrait.get_sheet_names()
// 获取sheet1数据 需要使用try{}catch (e){} 捕获错误
const firstSheetData  = xlsxTrait.get_first_sheet_data()
// 获取sheet1合并数据,// 需要使用try{}catch (e){} 捕获错误
const firstMergeCell = xlsxTrait.get_first_merge_cell()


// 所有方法如下
// 构造函数
// constructor(byte: Uint8Array);

// 获取所有获取所有sheet名称
// get_sheet_names(): (string)[];

// 获取指定sheet数据
// get_sheet_data(sheet_name: string): any;

// 获取第一个sheet名称
// get_first_sheet(): string;

// 获取第一个sheet数据
// get_first_sheet_data(): any;

// 获取指定sheet的合并单元格信息
// get_merge_cell(sheet_name: string): any;

// 获取第一个sheet的合并单元格信息
// get_first_merge_cell(): any;

Demo

const processFile = () => {
    const fileInput = document.getElementById('fileInput');
    const file = fileInput.files[0];

    if (!file) {
      alert('请先选择文件');
      return;
    }

    // 创建FileReader对象
    const reader = new FileReader();

    // 当文件读取完成时触发
    reader.onload = function (e) {
      // 将文件内容转换为Uint8Array
      const arrayBuffer = e.target.result;
      const uint8Array = new Uint8Array(arrayBuffer);

      // 显示文件信息
      const outputDiv = document.getElementById('output');
      outputDiv.innerHTML = `
                    文件名: ${file.name}<br>
                    文件大小: ${file.size} 字节<br>
                    Uint8Array长度: ${uint8Array.length} 字节
                `;

      console.time('start')
      const xlsxTrait = new wasm.XlsxTrait(uint8Array);
      const data  = xlsxTrait.get_first_sheet_data()
      console.timeEnd('start')
      const aaa = { data,
        merge_cell:[],
        sheet_names: [],}
      setData1(aaa)
    };
    // 以ArrayBuffer方式读取文件
    reader.readAsArrayBuffer(file);
  };


<input type="file" id="fileInput" />
<div id="output" style={{color:'#262626'}}></div>
<button onclick={processFile}>点击</button>