docs.sheetjs.com/docz/docs/03-demos/20-cli/index.md
2024-10-25 23:17:31 -04:00

3.3 KiB

title sidebar_label hide_table_of_contents pagination_prev pagination_next
Sheets on the Command Line Command-Line Tools true demos/desktop/index demos/data/index

import current from '/version.js'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import CodeBlock from '@theme/CodeBlock'; import {useCurrentSidebarCategory} from '@docusaurus/theme-common'; import FrameworkData from '/data/cli.js'

export const r = {style: {color:"red"}}; export const B = {style: {fontWeight:"bold"}};

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 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.

> xlsx-cli.exe pres.numbers
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:

    {useCurrentSidebarCategory().items.map((item, index) => { const listyle = (item.customProps?.icon) ? { listStyleImage: `url("${item.customProps.icon}")` } : {}; return (
  • {item.label}{item.customProps?.summary && (" - " + item.customProps.summary)}
  • ); })}

Platform Support

The following frameworks have been tested on the following platforms:

:::note pass

Asterisks (✱) in the Windows for ARM column mark tests that generated x64 binaries. The CLI tools run under the x64 emulator integrated in Windows.

:::

:::tip pass

The xlsx-cli NodeJS script is available as a package on the SheetJS CDN. It is a straightforward command-line tool for translating files between supported spreadsheet file formats.

:::

:::caution pass

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

The following demos for JS engines produce standalone programs: