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

hongfangze-office

v1.2.0

Published

comm.office

Downloads

10

Readme

常用的办公软件操作

介绍

目前已经实现了Excel的读写操作,后续增加Word、pdf、ppt等文件的操作。

/**
 * 读取Excel文件
 * @param {string} fpath 待读取的文件路径
 * @param {("json" | "array" | "csv")} [type="array"] 结果集的格式,默认array
 * @return {({ sheetName: string, data: Record<string, any> }[] | { sheetName: string, data: string }[] | { sheetName: string, data: string[] }[])} 返回的数据
 * - 该返回值必定为一个数组,每个元素为一个Sheet,包含了Sheet名称和具体的数据
 * - json 格式返回 { sheetName: string, data: Record<string, any> }[]
 * - csv 格式返回 { sheetName: string, data: string }[]
 * - array 格式返回 { sheetName: string, data: string[] }[]
 */
export const ReadExcel = _ReadExcel;
/**
 * 写Excel文件
 * @param {string} fpath 待写入的文件路径
 * @param {{ sheetName?: string, data: any[][] }[]} data 要写入的数据
 * - 一个Array<JSON>对象,包含了sheet名称和具体的数据
 * - 具体数据是一个二元数组,代表着每一行和每一列的数据
 * - 数据可以是number或string
 * @param {ISheetOptionses} [sheetOptions=null] 单元格等格式对象
 * - 如 {"!cols":[{"wch":6},{"wch":7}]}
 */
export const WriteExcel = _WriteExcel;
/**
 * 读取Excel文件
 * @param {string} fpath 待读取的文件路径
 * @return {{ [sheet: string]: xlsx.WorkSheet }} XLSX的对象数据
 */
export const AnalysisExcel = _AnalysisExcel;

/**
 * Excel读取的日期单元格为数字时转换成日期格式
 * @param {number} numb 要转换的数值
 * @param {string} [separator] 分隔符,默认"/"
 * @return {string} 转换后的日期
 */
export declare const ExcelDateConvert: (numb: number, separator?: string) => string;

/**
 * 将Excel行号和列号转换成列名
 * @param {number} row 行号,从1开始
 * @param {number} column 列号,从1开始
 * - (1,1) = A1
 * - (1,2) = B1
 * - (2,3) = C2
 * - 以此类推
 * @return {string}  Excel对应的列名
 */
export declare const ExcelCellNameConvert: (row: number, column: number) => string;

版本迭代记录

2025-05-09 v1.2.0

  • 增加函数,转换excel单元格名称。

2025-04-21 v1.1.0

  • 增加函数,转换excel的日期格式。

2025-04-11 v1.0.0

  • 被移除后更名发布。