命令行中的工作表
随着 JS 引擎的出现和服务器端平台的成功,从 JavaScript 代码构建独立的命令行工具成为可能。
¥With the availability of JS engines and the success of server-side platforms, it is possible to build standalone command-line tools from JavaScript code.
SheetJS 是一个用于从电子表格读取和写入数据的 JavaScript 库。
¥SheetJS is a JavaScript library for reading and writing data from spreadsheets.
该演示涵盖了构建独立电子表格处理器的多种策略。最终目标是使用 SheetJS 库从任意电子表格文件生成 CSV 输出。生成的命令行工具将接受参数,解析指定的工作簿,并将 CSV 行打印到终端。
¥This demo covers a number of strategies for building standalone spreadsheet processors. The ultimate goal is to use SheetJS libraries to generate CSV output from arbitrary spreadsheet files. The generated command-line tool will accept an argument, parse the specified workbook, and print CSV rows to the terminal.
> xlsx-cli.exe pres.numbers
Name,Index
Bill Clinton,42
GeorgeW Bush,43
Barack Obama,44
Donald Trump,45
Joseph Biden,46
常见独立 CLI 工具的演示包含在单独的页面中:
¥Demos for common standalone CLI tools are included in separate pages:
- nexe - Prebuilt NodeJS packages
- pkg - Prebuilt NodeJS packages
- boxednode - NodeJS binaries with scripts, built from source
- NodeJS SEA - Single Executable Applications
- BunJS SEA - BunJS Single-file Executables
- Deno SEA - Deno Standalone Binaries
平台支持
¥Platform Support
以下框架已在以下平台上进行了测试:
¥The following frameworks have been tested on the following platforms:
对于大多数常见的部署场景,可以安装服务器端平台,例如 NodeJS。
¥For most common deployment scenarios, it is possible to install a server-side platform such as NodeJS.
强烈建议尽可能使用专用平台。
¥It is strongly recommended to use a dedicated platform when possible.
当目标计算机上无法安装专用服务器端脚本平台时,此演示中生成的独立程序非常有用。
¥The standalone programs generated in this demo are useful when a dedicated server-side scripting platform cannot be installed on the target computer.
NodeJS
此演示按框架组织:
¥This demo has been organized by framework:
V8
¥The exposition has been moved to the "V8" demo.
BunJS
¥The exposition has been moved to a separate page.
Deno
¥The exposition has been moved to a separate page.
专用引擎
¥Dedicated Engines
以下 JS 引擎演示生成独立程序:
¥The following demos for JS engines produce standalone programs: