Skip to main content

Zen of SheetJSSheetJS的禅

SheetJS design and development is guided by a few key principles.SheetJS的设计和开发受几个关键原则的指导。

Data processing should fit in any workflow数据处理应适合任何工作流程

The library does not impose a separate lifecycle. It fits nicely in websites and apps built using any framework. 图书馆没有强加一个单独的生命周期。它非常适合使用任何框架构建的网站和应用程序。The plain JS data objects play nice with Web Workers and future APIs.简单的JS数据对象与Web Workers和未来的API配合得很好。

JavaScript is a powerful language for data processingJavaScript是一种功能强大的数据处理语言

The "Common Spreadsheet Format" is a simple object representation of the core concepts of a workbook. “通用电子表格格式”是工作簿核心概念的简单对象表示。Utilities公用事业 provide low-level tools for working with the object.提供用于处理对象的低级工具。

For friendly JS processing, there are utility functions for converting parts of a worksheet to/from an Array of Arrays. 对于友好的JS处理,有一些实用函数可以将工作表的部分转换为数组或从数组转换为数组。The Tutorial combines powerful JS Array methods with a network request library to download data, select the information we want and create a workbook file.教程将强大的JS数组方法与网络请求库相结合,用于下载数据、选择我们想要的信息并创建工作簿文件。

File formats are implementation details文件格式是实现细节

The parser covers a wide gamut of common spreadsheet file formats to ensure that "HTML-saved-as-XLS" files work as well as actual XLS or XLSX files.解析器涵盖了广泛的通用电子表格文件格式,以确保“保存为XLS的HTML”文件与实际的XLS或XLSX文件一样工作。

The writer supports a number of common output formats for broad compatibility with the data ecosystem.为了与数据生态系统广泛兼容,作者支持许多常见的输出格式。

To the greatest extent possible, data processing code should not have to worry about the specific file formats involved.在最大可能的范围内,数据处理代码不必担心所涉及的特定文件格式。

Data processing should be confidential数据处理应保密

All SheetJS-related methods run locally. No data is sent to a third party in processing data. No telemetry is collected.所有与SheetJS相关的方法都在本地运行。在处理数据时,不会向第三方发送任何数据。未收集到遥测数据。

SheetJS libraries are regularly used in offline scenarios to process personally identifiable information (PII) and other classified data.SheetJS库经常用于离线场景,用于处理个人身份信息(PII)和其他分类数据。