2022-07-31 23:45:34 +00:00
|
|
|
---
|
2024-05-29 05:10:39 +00:00
|
|
|
title: Sheets on the Command Line
|
|
|
|
sidebar_label: Command-Line Tools
|
|
|
|
hide_table_of_contents: true
|
2024-03-18 08:24:41 +00:00
|
|
|
pagination_prev: demos/desktop/index
|
2023-02-28 11:40:44 +00:00
|
|
|
pagination_next: demos/data/index
|
2022-07-31 23:45:34 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
import current from '/version.js';
|
2022-08-01 08:15:50 +00:00
|
|
|
import Tabs from '@theme/Tabs';
|
|
|
|
import TabItem from '@theme/TabItem';
|
2023-05-07 13:58:36 +00:00
|
|
|
import CodeBlock from '@theme/CodeBlock';
|
2024-03-18 08:24:41 +00:00
|
|
|
import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
|
2024-05-29 05:10:39 +00:00
|
|
|
import FrameworkData from '/data/cli.js'
|
2022-07-31 23:45:34 +00:00
|
|
|
|
2024-05-28 05:20:05 +00:00
|
|
|
export const r = {style: {color:"red"}};
|
|
|
|
export const B = {style: {fontWeight:"bold"}};
|
|
|
|
|
2022-08-25 08:22:28 +00:00
|
|
|
With the availability of JS engines and the success of server-side platforms,
|
2024-03-18 08:24:41 +00:00
|
|
|
it is possible to build standalone command-line tools from JavaScript code.
|
2022-07-31 23:45:34 +00:00
|
|
|
|
2024-03-18 08:24:41 +00:00
|
|
|
[SheetJS](https://sheetjs.com) is a JavaScript library for reading and writing
|
|
|
|
data from spreadsheets.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
2024-05-28 05:20:05 +00:00
|
|
|
```bash title="Sample terminal session"
|
|
|
|
> xlsx-cli.exe pres.numbers
|
2024-03-18 08:24:41 +00:00
|
|
|
Name,Index
|
|
|
|
Bill Clinton,42
|
|
|
|
GeorgeW Bush,43
|
|
|
|
Barack Obama,44
|
|
|
|
Donald Trump,45
|
|
|
|
Joseph Biden,46
|
|
|
|
```
|
|
|
|
|
|
|
|
Demos for common standalone CLI tools are included in separate pages:
|
|
|
|
|
|
|
|
<ul>{useCurrentSidebarCategory().items.map((item, index) => {
|
|
|
|
const listyle = (item.customProps?.icon) ? {
|
|
|
|
listStyleImage: `url("${item.customProps.icon}")`
|
|
|
|
} : {};
|
|
|
|
return (<li style={listyle} {...(item.customProps?.class ? {className: item.customProps.class}: {})}>
|
|
|
|
<a href={item.href}>{item.label}</a>{item.customProps?.summary && (" - " + item.customProps.summary)}
|
|
|
|
</li>);
|
|
|
|
})}</ul>
|
2022-07-31 23:45:34 +00:00
|
|
|
|
2024-05-29 05:10:39 +00:00
|
|
|
#### Platform Support
|
|
|
|
|
|
|
|
The following frameworks have been tested on the following platforms:
|
|
|
|
|
|
|
|
<FrameworkData/>
|
|
|
|
|
2023-10-11 02:18:57 +00:00
|
|
|
:::tip pass
|
|
|
|
|
|
|
|
The [`xlsx-cli`](https://cdn.sheetjs.com/xlsx-cli/) NodeJS script is available
|
2024-05-29 05:10:39 +00:00
|
|
|
as a package on the SheetJS CDN. It is a straightforward command-line tool for
|
2023-10-11 02:18:57 +00:00
|
|
|
translating files between supported spreadsheet file formats.
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
2024-03-18 08:24:41 +00:00
|
|
|
:::caution pass
|
|
|
|
|
|
|
|
For most common deployment scenarios, it is possible to install a server-side
|
|
|
|
platform such as [NodeJS](/docs/getting-started/installation/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.
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
2024-05-29 05:10:39 +00:00
|
|
|
#### NodeJS
|
2024-05-28 05:20:05 +00:00
|
|
|
|
2024-05-29 05:10:39 +00:00
|
|
|
This demo has been organized by framework:
|
2024-05-28 05:20:05 +00:00
|
|
|
|
2024-05-29 05:10:39 +00:00
|
|
|
- [`boxednode`](/docs/demos/cli/boxednode)
|
|
|
|
- [`nexe`](/docs/demos/cli/nexe)
|
|
|
|
- [`pkg`](/docs/demos/cli/pkg)
|
2024-05-28 05:20:05 +00:00
|
|
|
|
2024-05-29 05:10:39 +00:00
|
|
|
#### V8
|
2024-05-28 05:20:05 +00:00
|
|
|
|
2024-05-29 05:10:39 +00:00
|
|
|
**[The exposition has been moved to the "V8" demo.](/docs/demos/engines/v8#snapshots)**
|
2024-05-28 05:20:05 +00:00
|
|
|
|
2024-05-29 05:10:39 +00:00
|
|
|
#### BunJS
|
2024-05-28 05:20:05 +00:00
|
|
|
|
2024-05-29 05:10:39 +00:00
|
|
|
**[The exposition has been moved to a separate page.](/docs/demos/cli/bunsea)**
|
2023-05-25 01:36:15 +00:00
|
|
|
|
2024-03-18 08:24:41 +00:00
|
|
|
#### Deno
|
2023-05-09 08:08:01 +00:00
|
|
|
|
2024-05-29 05:10:39 +00:00
|
|
|
**[The exposition has been moved to a separate page.](/docs/demos/cli/denosea)**
|
2023-05-09 08:08:01 +00:00
|
|
|
|
2024-05-29 05:10:39 +00:00
|
|
|
#### Dedicated Engines
|
2023-05-09 08:08:01 +00:00
|
|
|
|
|
|
|
The following demos for JS engines produce standalone programs:
|
|
|
|
|
2024-05-29 05:10:39 +00:00
|
|
|
- [V8](/docs/demos/engines/v8)
|
2023-05-09 08:08:01 +00:00
|
|
|
- [Duktape](/docs/demos/engines/duktape)
|
2023-05-23 06:28:14 +00:00
|
|
|
- [ChakraCore](/docs/demos/engines/chakra)
|
|
|
|
- [QuickJS](/docs/demos/engines/quickjs)
|
2023-05-09 08:08:01 +00:00
|
|
|
- [Goja](/docs/demos/engines/goja)
|
|
|
|
- [JavaScriptCore](/docs/demos/engines/jsc)
|