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

gh-excel

v1.0.1

Published

base xlsxjs

Readme

基于 xlsx.js, 目前支持 ES6

开始

npm

$ install gh-excel

interface Sheet2JSONOpts extends DateNFOption {
  /** Output format */
  header?: 'A' | number | string[];

  /** Override worksheet range */
  range?: any;

  /** Include or omit blank lines in the output */
  blankrows?: boolean;

  /** Default value for null/undefined values */
  defval?: any;

  /** if true, return raw data; if false, return formatted text */
  raw?: boolean;

  /** if true, return raw numbers; if false, return formatted numbers */
  rawNumbers?: boolean;
}

demo

import myExcel from 'gh-excel';

// xlsx 配置 Sheet2JSONOpts
const defaultOption = {
  raw: true,
  blankrows: true,
  header: 1,
  defval: ''
};

// 时间转换格式 default 'YYYY-MM-DD'
const dateFormat = 'YYYY-MM-DD';

// 日期字段需要格式化字段key
const dateKeys = [];

// Array 字段重复key 转换 如
//  [{
//    tableName: 'demo',
//    if: 'demo',
//    to: 'demo1'
//  },...]
const repeactChangeKeys = {};

// 根据sheet
// [{
//     key: 'DEMO', //sheetkey
//     name: '测试', //sheet名
//     reg: /测试/, //正则匹配
//     h: 2 // 从 h+1 行读取表格数据
// }]
const ExcelTypeKeys = [];

// 正则匹配 转换成程序需要的key 如下 如果表头字段正则匹配成功 转换为 结果字段替换为 'test'
//{
//    key: 'test',
//    reg: /测试/
//}
const keys = [];

// excel 表格读取模糊匹配存在重复,重写此方法
/**
 * @param obj {msg,data}
 * @param str ['x','x'].join() excel 表第一行数据
 * @returns {key:String,reg:RegRex,h:Number} obj
 */
const checkKey = function(obj, str) {
  return obj;
};
myExcel.init({
  defaultOption,
  dateFormat,
  dateKeys,
  repeactChangeKeys,
  ExcelTypeKeys,
  keys,
  checkKey
})
myExcel.readExcel(File || remote URL ).then(res=>{
  console.log(res)
})
![avatar](./result.png)