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 🙏

© 2024 – Pkg Stats / Ryan Hefner

excel-file

v1.1.1

Published

fix entry

Downloads

167

Readme

exFile 是一个基于 JavaScript 的电子表格处理库,它允许开发者读取和写入 Excel 文件,无论是简单的数据导入导出,还是复杂的数据处理和格式设置,exFile 都能提供支持。


主要特性文档

1. 从 Excel 中读取 JSON 数据

允许用户从 Excel 文件中提取数据并转换为 JSON 格式,以便于进行数据处理和分析。

1.1 所需工具

  • exceljs(用于处理 Excel 文件)

1.2 从 Excel 中读取数据

npm install excel-file

# 在需要使用的页面中引用

import { readExcel } from './ex-file'

readExcel(file,headLine).then(res=>{
	// 读取的sheet
})
  • readExcel 传递参数

|字段|类型|是否必填|默认|注释| |:---- |:------- |:--- |---|------ | |file |buffer |是 | - | 读取的文件 | |headLine |number |否 | 1 | 可指定表头行数,默认第一行是表头 |

  • 返回参数

|字段|类型| 说明| |:---- |:------- |------ | |sheetName|string | 文件名称 | |rowTotal |number | 具有值的行数的计数。 如果中间文档行为空,则该行将不包括在计数中。 | |columnTotal |number | 文档的总列数。 等于所有行的最大单元数。。 | |cellList |Array | 所有单元格 | |headList |Array | 表格表头列表 | |dataList |Array | 表格内容 |

  • cell 参数

|字段|类型| 说明| |:---- |:------- |------ | |row|number | 行号 | |type |number |  1字符 2日期 3公式值json ... | |address |string |  行列坐标定位(例如:"A1") | |text |string | 单元格读取内容 |

  • head 参数

|字段|类型| 说明| |:---- |:------- |------ | |prop|string | 表头唯一标识符 | |label |string |  表头标题 | |isMerged |boolean |  是否是合并单元格 |

  • data(object) 参数说明

|字段|类型| 说明| |:---- |:------- |------ | |key| string | 与表头prop保持一致 | |value |string |  表格读取内容 |

3. 总结

本指南展示了如何从 Excel 文件中读取 JSON 数据,以及如何将 JSON 数据导出为 XLSX 文件。这些功能可以帮助用户高效处理和转换数据。


如果您需要更详细的信息或有其他相关问题,请告诉我!