{"_id":"@ai-path/tb-io","_rev":"2-9557835cdb75dfc6b08ea65758b9fea8","name":"@ai-path/tb-io","dist-tags":{"latest":"0.3.0"},"versions":{"0.2.0":{"name":"@ai-path/tb-io","version":"0.2.0","license":"MIT","_id":"@ai-path/tb-io@0.2.0","maintainers":[{"name":"fsakurai","email":"f-sakurai@ai-path.jp"}],"homepage":"https://github.com/aipathjp/lattica#readme","bugs":{"url":"https://github.com/aipathjp/lattica/issues"},"dist":{"shasum":"0653b53687280ce4d1d93dd807e5e992dd398b51","tarball":"https://registry.npmjs.org/@ai-path/tb-io/-/tb-io-0.2.0.tgz","fileCount":9,"integrity":"sha512-cEVFpprRtjGwbZ1r99n0+AWtVWdXtwPHmN1yzoZV/RAxyFneH8sy3FLSoJDATanhdj5xoL8k6eZE2Zh0YTZ7FQ==","signatures":[{"sig":"MEQCIEZaVpLN63aNLFONX6IKIT+1O2j9t0iv6Nz+8EaSRX7aAiAQ8ZxGbhkPLmbcHQQ/FPKYacm3r6kB1em8eRMjIIWI4A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":319143},"main":"./dist/index.cjs","type":"module","_from":"file:ai-path-tb-io-0.2.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"fsakurai","email":"f-sakurai@ai-path.jp"},"_resolved":"/private/var/folders/tf/0c43660d4k1dg4ssxq0n63ww0000gn/T/5390eee2d36a0a70d9dc9772654928af/ai-path-tb-io-0.2.0.tgz","_integrity":"sha512-cEVFpprRtjGwbZ1r99n0+AWtVWdXtwPHmN1yzoZV/RAxyFneH8sy3FLSoJDATanhdj5xoL8k6eZE2Zh0YTZ7FQ==","repository":{"url":"git+https://github.com/aipathjp/lattica.git","type":"git","directory":"packages/io"},"_npmVersion":"10.9.3","description":"Import/export for Taible: CSV/TSV parsing & serialization, clipboard (TSV + HTML) interop, and dependency-free XLSX (OOXML) export.","directories":{},"sideEffects":false,"_nodeVersion":"22.18.0","dependencies":{"@ai-path/tb-core":"0.2.0"},"publishConfig":{"access":"public","provenance":false},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tb-io_0.2.0_1783181303533_0.2759124507597115","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@ai-path/tb-io","version":"0.3.0","description":"Import/export for Taible: CSV/TSV parsing & serialization, clipboard (TSV + HTML) interop, and dependency-free XLSX (OOXML) export.","license":"MIT","type":"module","sideEffects":false,"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"dependencies":{"@ai-path/tb-core":"0.3.0"},"publishConfig":{"access":"public","provenance":false},"repository":{"type":"git","url":"git+https://github.com/aipathjp/lattica.git","directory":"packages/io"},"homepage":"https://github.com/aipathjp/lattica#readme","bugs":{"url":"https://github.com/aipathjp/lattica/issues"},"scripts":{"build":"tsup","typecheck":"tsc --noEmit"},"_id":"@ai-path/tb-io@0.3.0","_integrity":"sha512-Nunt/TDK2KUfE9AW5IdOKvd4yYqO0NXSy9fbiGKMzyd0tgw0F24sIZ4RGC2KqMzrx+GQVnG+0W2V6QUeNG/XRQ==","_resolved":"/private/var/folders/tf/0c43660d4k1dg4ssxq0n63ww0000gn/T/2803c1d123dc6fff23e1fed4658a8259/ai-path-tb-io-0.3.0.tgz","_from":"file:ai-path-tb-io-0.3.0.tgz","_nodeVersion":"22.18.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-Nunt/TDK2KUfE9AW5IdOKvd4yYqO0NXSy9fbiGKMzyd0tgw0F24sIZ4RGC2KqMzrx+GQVnG+0W2V6QUeNG/XRQ==","shasum":"c247b2704a0c8d67693ca8708d1b2f4cbe293515","tarball":"https://registry.npmjs.org/@ai-path/tb-io/-/tb-io-0.3.0.tgz","fileCount":9,"unpackedSize":319143,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIH5BamFysW76XS9g6yhJl3JtcVsNr5FBOzoFJda/PbfIAiAYoHc22LKzOSOpTTFJyczZG2rDXzwae0FDlBI46M3ZHQ=="}]},"_npmUser":{"name":"fsakurai","email":"f-sakurai@ai-path.jp"},"directories":{},"maintainers":[{"name":"fsakurai","email":"f-sakurai@ai-path.jp"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tb-io_0.3.0_1783188080762_0.3708566914188409"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-04T16:08:23.410Z","modified":"2026-07-04T18:01:21.069Z","0.2.0":"2026-07-04T16:08:23.666Z","0.3.0":"2026-07-04T18:01:20.922Z"},"bugs":{"url":"https://github.com/aipathjp/lattica/issues"},"license":"MIT","homepage":"https://github.com/aipathjp/lattica#readme","repository":{"type":"git","url":"git+https://github.com/aipathjp/lattica.git","directory":"packages/io"},"description":"Import/export for Taible: CSV/TSV parsing & serialization, clipboard (TSV + HTML) interop, and dependency-free XLSX (OOXML) export.","maintainers":[{"name":"fsakurai","email":"f-sakurai@ai-path.jp"}],"readme":"# @ai-path/tb-io\n\nImport/export and clipboard interop for Taible, with no runtime dependencies.\nIt includes an RFC 4180 delimited-text (CSV/TSV) codec, clipboard text/HTML\nhelpers, and a from-scratch XLSX reader and writer (built on an embedded\nZIP/deflate implementation). Everything operates on plain string/value matrices\nso it stays decoupled from the grid models.\n\n## Install\n\n```sh\npnpm add @ai-path/tb-io\n```\n\n## API overview\n\n### CSV / TSV\n\n`parseDelimited` / `serializeDelimited` follow RFC 4180 quoting; `parseTsv` /\n`serializeTsv` are tab-delimited shortcuts.\n\n```ts\nimport { parseDelimited, serializeDelimited, parseTsv } from '@ai-path/tb-io';\n\nconst rows = parseDelimited('name,age\\n\"Doe, J\",42'); // [['name','age'],['Doe, J','42']]\nconst csv = serializeDelimited(rows);                  // back to a CSV string\nconst tsv = parseTsv('a\\tb\\nc\\td');\n```\n\n`DelimitedOptions` lets you override the `delimiter` and `quote` characters.\n\n### Clipboard\n\n```ts\nimport { toClipboardText, toClipboardHtml, parseClipboard } from '@ai-path/tb-io';\n\nconst text = toClipboardText([['a', 'b'], ['c', 'd']]); // TSV for the clipboard\nconst html = toClipboardHtml([['a', 'b']]);             // an HTML <table>\nconst matrix = parseClipboard({ text, html });          // prefers HTML when present\n```\n\n### XLSX write\n\nBuild a workbook from cell matrices (`XlsxCell` = `string | number | boolean | null`).\n\n```ts\nimport { writeXlsx, matrixToXlsx, type XlsxWorkbook } from '@ai-path/tb-io';\n\nconst bytes = matrixToXlsx([['Name', 'Qty'], ['Widget', 3]], 'Sheet1');\n\nconst workbook: XlsxWorkbook = {\n  sheets: [{ name: 'Data', rows: [['a', 1], ['b', 2]] }],\n};\nconst wbBytes = writeXlsx(workbook); // Uint8Array\n```\n\n### XLSX read\n\n```ts\nimport { readXlsx, type ReadWorkbook } from '@ai-path/tb-io';\n\nconst wb: ReadWorkbook = readXlsx(bytes);\nwb.sheets[0]?.name;\nwb.sheets[0]?.rows; // (string | number | boolean | null)[][]\n```\n\nLow-level building blocks (`crc32`, `buildZip`, `inflateRaw`, `parseHtmlTable`)\nare also exported for advanced use.\n","readmeFilename":"README.md"}