---
title: TxikiJS Standalone Apps
sidebar_label: txiki.js
pagination_prev: demos/desktop/index
pagination_next: demos/data/index
sidebar_custom_props:
summary: Compiled apps powered by QuickJS and txiki.js
---
import current from '/version.js';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import CodeBlock from '@theme/CodeBlock';
`txiki.js` is a small runtime powered by [QuickJS](/docs/demos/engines/quickjs).
[SheetJS](https://sheetjs.com) is a JavaScript library for reading and writing
data from spreadsheets.
This demo uses `txiki.js` and SheetJS to create a standalone CLI tool for
parsing spreadsheets and generating CSV rows.
:::caution TxikiJS support is considered experimental.
Great open source software grows with user tests and reports. Any issues should
be reported to the `txiki.js` project for further diagnosis.
:::
## Integration Details
The [SheetJS Standalone scripts](/docs/getting-started/installation/standalone)
can be evaluated and consumed in TxikiJS.
The platform provides APIs for filesystem operations that differ from NodeJS:
- `tjs.readFile` reads raw data from a specified filename and returns a Promise
that resolves to a `Uint8Array`
- `tjs.args` is an array of arguments. In the compiled program, the first value
will be the program name and the second value will be the first argument.
The SheetJS filesystem methods ([`readFile`](/docs/api/parse-options) and
[`writeFile`](/docs/api/parse-options)) do not recognize the `txiki.js` APIs.
Fortunately, `read` and `write` directly work with `Uint8Array` data.
The following example reads and parses `pres.xlsx` in the current directory:
```js title="Parse pres.xlsx in TxikiJS"
/* read data from pres.xlsx into a Uint8Array */
const data = await tjs.readFile("pres.xlsx");
/* parse data and generate a SheetJS workbook object */
const wb = XLSX.read(data);
```
### Script Requirements
The compiler does not bundle scripts automatically. Scripts that exclusively use
web APIs, SheetJS API methods, and `tjs` API methods can be bundled and compiled.
[`esbuild`](/docs/demos/frontend/bundler/esbuild) is the recommended bundler.
For example, the following script accepts one command line argument, parses the
specified file using `tjs.readFile` and the SheetJS `read` method[^1], generates
CSV text from the first sheet using `sheet_to_csv`[^2], and prints the result:
```js title="sheet2csv.js (before bundling)"
const XLSX = require("./xlsx.full.min");
/* tjs.args[1] is the first argument to the script */
const filename = tjs.args[1];
/* read and parse file */
const data = await tjs.readFile(filename);
const wb = XLSX.read(data);
/* generate CSV of first sheet */
const ws = wb.Sheets[wb.SheetNames[0]];
const csv = XLSX.utils.sheet_to_csv(ws);
/* print to terminal */
console.log(csv);
```
## Complete Example
:::note Tested Deployments
This demo was tested in the following deployments:
| Architecture | TxikiJS | Date |
|:-------------|:----------|:-----------|
| `darwin-x64` | `24.12.0` | 2025-04-19 |
| `darwin-arm` | `24.12.0` | 2025-04-19 |
| `win11-x64` | `24.12.0` | 2025-04-19 |
| `win11-arm` | `24.12.0` | 2025-04-19 |
| `linux-x64` | `24.12.0` | 2025-04-19 |
| `linux-arm` | `24.12.0` | 2025-04-19 |
:::
:::caution pass
TxikiJS on Windows on ARM uses the X64 compatibility layer. It does not generate
a native ARM64 binary!
:::
0) Create a new project folder and download `txiki.js`[^3]: