lacspace-excel

The Excel Swiss-army knife — convert anything ⇄ Excel, run formulas, prebuilt templates.

terminal
npx lacspace-excel convert data.json -o data.xlsx
What it does

Everything, in one command

lacspace-excel is the hosted-and-local face of the Lacspace Sheets Kit — the engine behind LUMIFORM, the editable grid inside Lacspace's ERPs. Under the hood it composes @lacspace/convert (format detection and conversion), @lacspace/xlsx (a dependency-free .xlsx reader/writer with formula cells), @lacspace/csv and @lacspace/formula (110+ Excel-style functions, no eval). Nested JSON becomes flat columns and comes back losslessly; numbers, booleans and dates are inferred conservatively; CSV and SQL output are injection-safe by default. Everything runs on your machine or in your browser — no key, no upload, no telemetry.

Features

What's inside

Any ⇄ Excel

JSON, CSV, TSV, NDJSON, YAML, TOML, Markdown, HTML and SQL to .xlsx — and back — with input auto-detection.

Nested JSON → columns

address.city, items.0.sku flatten to columns and unflatten back, losslessly.

Typed inference

Numbers, booleans and dates are recognised only when a whole column agrees; IDs and zip codes stay text.

Inspect a workbook

Sheets, dimensions, inferred column types and sample rows — as a table or --json.

Computed columns

--add "margin=(price-cost)/price*100" — 110+ Excel-style functions, SUMIFS, LOOKUP, dates, text; never eval.

17 prebuilt templates

Invoice, quotation, purchase order, inventory, price list, CRM, orders, expenses, payroll, cashbook, attendance, budget, tax register, timesheet, project tracker, loan/EMI schedule, grade book.

Live formulas inside

Templates carry real =B2*C2 / SUM() cells with cached values — Excel, Numbers and Sheets recalculate them.

Dedupe, split, merge

Drop duplicate rows by column, split a workbook into per-sheet files, or merge files into one workbook.

Injection-safe output

Cells starting with = + - @ are neutralised in CSV; SQL values are properly quoted.

Function reference

lacspace-excel functions SUMIF — signature, description and example for every function.

Pipe-friendly

Reads stdin, writes stdout for text formats, exits non-zero on failure — drop it into CI or a cron job.

Zero deps, fully typed

Dual ESM+CJS library sharing the CLI engine; runs in Node, edge and the browser.

How to use

Copy, paste, done

Real commands and snippets — from a one-liner to the typed library.

JSON → Excel
terminal
npx lacspace-excel convert orders.json -o orders.xlsx --flatten

Nested objects become columns; one sheet per top-level key.

Excel → JSON
terminal
npx lacspace-excel convert book.xlsx --sheet Orders --to json

Typed rows to stdout; pick a sheet by name or index.

CSV → Markdown table
terminal
cat people.csv | npx lacspace-excel convert --from csv --to markdown --columns name,email

Reads stdin; keeps only the columns you want.

Inspect a workbook
terminal
npx lacspace-excel inspect sales.xlsx

Sheets, rows × columns, inferred types, sample rows.

Add a computed column
terminal
npx lacspace-excel formula stock.xlsx --add "margin=(price-cost)/price*100" -o stock.xlsx

Safe formula engine; the column is written with values.

Generate a template
terminal
npx lacspace-excel template invoice -o invoice.xlsx

Ready to fill, with live totals. `template list` shows all 17.

Dedupe by column
terminal
npx lacspace-excel dedupe leads.csv --by email -o clean.csv

Keeps the first occurrence.

Use it as a library
typescript
import { convert } from "@lacspace/convert";
import { buildTemplate } from "lacspace-excel";

const xlsx = await convert(rows, { to: "xlsx", sheet: "Orders" });
const invoice = buildTemplate("invoice");
Good for

What people build with it

Turn an API response or database export into a spreadsheet for the finance team

Import a customer's Excel/CSV into your app as clean, typed JSON

Hand out ready-made invoice, payroll and inventory workbooks with formulas that just work

Add margin, tax or totals columns to a sheet from a script or CI

Start now

Run lacspace-excel today

Free, open-source, no API keys. It's a CLI and a typed library.

terminal
npx lacspace-excel convert data.json -o data.xlsx