@forgedevstack/ink-excel
v0.1.0
Published
Ink Excel plugin — import/export spreadsheet tables for @forgedevstack/ink via JS register or config.
Maintainers
Readme
@forgedevstack/ink-excel
Excel / CSV plugin for Ink. Mirrors the Ink AI install pattern: register in JS, optional config in the host app.
Native
.xlsx+ MCP wiring ships in sprint 1.1.5. This package starts with a CSV handler that produces InkInk-tableHTML.
Install
npm install @forgedevstack/ink @forgedevstack/ink-excelPattern A — JS register (same idea as inkAi.registerProvider)
import { InkEditor } from '@forgedevstack/ink';
import { inkExcel, createCsvExcelHandler } from '@forgedevstack/ink-excel';
inkExcel.register(createCsvExcelHandler());
async function onPickFile(file: File, setHtml: (html: string) => void) {
const result = await inkExcel.import(file);
setHtml(result.html);
}
async function onExport(html: string) {
const blob = await inkExcel.export(html, { format: 'csv', fileName: 'sheet.csv' });
// download blob…
}Pattern B — config object (host-owned)
import type { InkExcelConfig } from '@forgedevstack/ink-excel';
const excel: InkExcelConfig = {
enabled: true,
handlerId: 'csv',
};
// Host UI reads `excel` and calls inkExcel.import / export.
// Core Ink can later accept excel?: InkExcelConfig the same way as ai?: InkAiConfig.Custom handler
inkExcel.register({
id: 'acme-xlsx',
name: 'Acme XLSX',
import: async (input) => {
// parse workbook → Ink table HTML
return { html: '<table class="Ink-table">…</table>', rows: 2, cols: 2 };
},
export: async (html) => new Blob([html], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }),
});Repo
https://github.com/yaghobieh/ink-excel
