lacspace-excel
The Excel Swiss-army knife — convert anything ⇄ Excel, run formulas, prebuilt templates.
npx lacspace-excel convert data.json -o data.xlsxEverything, 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.
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.
Copy, paste, done
Real commands and snippets — from a one-liner to the typed library.
npx lacspace-excel convert orders.json -o orders.xlsx --flattenNested objects become columns; one sheet per top-level key.
npx lacspace-excel convert book.xlsx --sheet Orders --to jsonTyped rows to stdout; pick a sheet by name or index.
cat people.csv | npx lacspace-excel convert --from csv --to markdown --columns name,emailReads stdin; keeps only the columns you want.
npx lacspace-excel inspect sales.xlsxSheets, rows × columns, inferred types, sample rows.
npx lacspace-excel formula stock.xlsx --add "margin=(price-cost)/price*100" -o stock.xlsxSafe formula engine; the column is written with values.
npx lacspace-excel template invoice -o invoice.xlsxReady to fill, with live totals. `template list` shows all 17.
npx lacspace-excel dedupe leads.csv --by email -o clean.csvKeeps the first occurrence.
import { convert } from "@lacspace/convert";
import { buildTemplate } from "lacspace-excel";
const xlsx = await convert(rows, { to: "xlsx", sheet: "Orders" });
const invoice = buildTemplate("invoice");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
Run lacspace-excel today
Free, open-source, no API keys. It's a CLI and a typed library.
npx lacspace-excel convert data.json -o data.xlsx