Skip to main content

Command-Line Tools

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.

Sample terminal session

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

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

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.


There are a few popular tools for compiling NodeJS scripts to CLI programs.

The demo script presents a friendly command line interface including flags:

$ ./xlsx-cli -h
Usage: xlsx-cli [options] <file> [sheetname]

-V, --version output the version number
-f, --file <file> use specified workbook
-s, --sheet <sheet> print specified sheet (default first sheet)
Tested Deployments

This demo was tested in the following deployments:

  1. Download the test file
curl -o pres.numbers
  1. Download xlsx-cli.js
curl -o xlsx-cli.js
  1. Install the dependencies:
yarn add exit-on-epipe commander@2
  1. Follow tooling steps:

Run nexe and manually specify NodeJS version 14.15.3

npx nexe -t 14.15.3 xlsx-cli.js

This generates xlsx-cli or xlsx-cli.exe depending on platform.

When the demo was tested on ARM targets, the Nexe pre-built packages were missing. The package must be built from source:

npx nexe xlsx-cli.js --build --python=$(which python3) --make="-j8"

On Windows ARM, the target windows-arm64-20.10.0 must be specified:

npx nexe xlsx-cli.js --build --make="-j8" --target=windows-arm64-20.10.0

The Windows build may fail with a vcbuild.bat error:

Error: vcbuild.bat nosign release arm64 exited with code: 1

Pass the -v flag for more details. In the most recent test, the error stemmed from a Python version mismatch:

Node.js configure: found Python 2.7.18
Please use python3.11 or python3.10 or python3.9 or python3.8 or python3.7 or python3.6

The resolved version of Python can be found with

where python

In the most recent test, a Python 2 version appeared first. This was fixed by finding the Python 3 location and prepending it to PATH:

set PATH="C:\correct\path\to\python\three";%PATH%
  1. Run the generated program, passing pres.numbers as the argument. For example, nexe generates xlsx-cli in macOS so the command is:
./xlsx-cli pres.numbers

nexe generates xlsx-cli.exe in Windows, so the command is:

.\xlsx-cli.exe pres.numbers


The V8 demo covers standalone programs that embed the V8 engine. This demo uses the Rust integration to generate a command line tool.

Tested Deployments

This demo was last tested in the following deployments:

ArchitectureV8 VersionCrateDate
  1. Make a new folder for the project:
mkdir sheetjs2csv
cd sheetjs2csv
  1. Download the following scripts:
curl -o Cargo.toml
curl -o
curl -o
  1. Download the SheetJS Standalone script and move to the project directory:
curl -o xlsx.full.min.js
  1. Build the V8 snapshot:
cargo build --bin snapshot
cargo run --bin snapshot

With some versions of the v8 crate, the Linux AArch64 build failed with an error:

error[E0080]: evaluation of constant value failed

1715 | assert!(size_of::<TypeId>() == size_of::<u64>());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'assertion failed: size_of::<TypeId>() == size_of::<u64>()'

Versions 0.75.1 and 0.82.0 are known to work.

  1. Build sheet2csv (sheet2csv.exe in Windows):
cargo build --release --bin sheet2csv
  1. Download the test file
curl -o pres.numbers
  1. Test the application:
mv target/release/sheet2csv .
./sheet2csv pres.numbers


The exposition has been moved to a separate page.

Dedicated Engines

The following demos for JS engines produce standalone programs:


  1. Downloads can be found at the main NASM project website