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

wechat-xlsx

v1.2.0

Published

xlsx-js-style patched for WeChat Mini Program compatibility

Readme

wechat-xlsx

微信小程序专用的 Excel/CSV 文件处理库。

基于 xlsx-js-style v1.2.0 裁剪适配,移除了微信环境不兼容的 require() 调用,可直接在微信小程序中使用。

安装

npm install wechat-xlsx

使用

const XLSX = require('wechat-xlsx');

// 读取 Excel 文件
const workbook = XLSX.read(data, { type: 'array' });

// 读取 CSV 文件
const csvData = 'name,age\n张三,25';
const workbook = XLSX.read(csvData, { type: 'string', sheetRows: 100 });

// 获取工作表
const sheetName = workbook.SheetNames[0];
const sheet = workbook.Sheets[sheetName];

// 转为 JSON
const jsonData = XLSX.utils.sheet_to_json(sheet);

// 写入 Excel
const ws = XLSX.utils.json_to_sheet(jsonData);
const wb = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');

// 生成文件(ArrayBuffer)
const wbout = XLSX.write(wb, { bookType: 'xlsx', type: 'array' });

// 保存到本地(微信小程序)
wx.getFileSystemManager().writeFile({
  filePath: `${wx.env.USER_DATA_PATH}/output.xlsx`,
  data: wbout,
  encoding: 'binary',
  success: () => console.log('保存成功')
});

API

完整的 API 请参考 SheetJS 官方文档

常用方法

| 方法 | 说明 | |------|------| | XLSX.read(data, opts) | 读取 Excel/CSV 数据 | | XLSX.readFile(path) | 读取文件(Node.js 环境) | | XLSX.write(workbook, opts) | 写入 Excel | | XLSX.utils.sheet_to_json(sheet) | 工作表转 JSON | | XLSX.utils.json_to_sheet(data) | JSON 转工作表 | | XLSX.utils.book_append_sheet(wb, sheet, name) | 添加工作表 |

与原版 xlsx-js-style 的区别

  • 移除了 Node.js 环境的 require() 调用(如 require('jszip')
  • 移除了浏览器环境的 require() 调用
  • 适配微信小程序的 wx.requestwx.getFileSystemManager 等 API
  • 保留了所有核心功能:读写 Excel/CSV/Formulae

License

Apache-2.0
原版由 SheetJS LLC 开发。