{"_id":"tabularjs","_rev":"2-c1708f1f36da358c6dade3122f4698d6","name":"tabularjs","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"tabularjs","version":"1.0.0","keywords":["javascript plugins","javascript components"],"author":{"name":"Contact","email":"contact@jspreadsheet.com"},"_id":"tabularjs@1.0.0","maintainers":[{"name":"hodeware","email":"support@jspreadsheet.com"}],"homepage":"https://github.com/tabularjs/tabularjs#readme","bugs":{"url":"https://github.com/tabularjs/tabularjs/issues"},"dist":{"shasum":"a3edf6d090876eb0653474864239830676ff4561","tarball":"https://registry.npmjs.org/tabularjs/-/tabularjs-1.0.0.tgz","fileCount":3,"integrity":"sha512-1ODDtevkPWbzCI5MU+bGSiOZVd6D1QJ3UhDiXJbZ0Cqshbx+hKunRvR97Dt4fi/WburQ63xbcVqKbmfyE6hf8A==","signatures":[{"sig":"MEQCID0C9JGKaaiOCvSNDIqLzNGHCNb7AYx2pI3XbkpHWgZnAiBeFTNg1f/70xvZwEktntBhEZ2i6qIlcXH8c/V7c0YaKw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":632},"main":"dist/index.js","title":"Convert XLSX, XLS, XML, ODS, CSV to JSON compatible with Jspreadsheet.","types":"dist/index.d.ts","gitHead":"81987c51efb9d7c198712f7c0a83fbc7e4dd4cb4","_npmUser":{"name":"hodeware","email":"support@jspreadsheet.com"},"repository":{"url":"git+https://github.com/tabularjs/tabularjs.git","type":"git"},"_npmVersion":"10.2.4","description":"SheetPorter","directories":{},"_nodeVersion":"21.4.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tabularjs_1.0.0_1764358215793_0.056799239744690366","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"tabularjs","version":"1.0.1","description":"Professional JavaScript library for converting spreadsheet files to JSON format. Supports 16+ file formats for use in Node.js and browser applications.","type":"module","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"start":"webpack serve --mode development --config webpack.config.js --watch","build":"webpack --mode production && node -e \"require('fs').copyFileSync('src/index.d.ts', 'dist/index.d.ts')\"","test":"mocha test/**/*.test.js","test:coverage":"c8 --reporter=text --reporter=html --reporter=lcov npm test","test:watch":"mocha test/**/*.test.js --watch"},"keywords":["spreadsheet","parser","converter","excel","xls","xlsx","ods","opendocument","csv","tsv","lotus","wks","sylk","slk","dif","dbf","dbase","html-table","xml-spreadsheet","json","file-converter","data-import","jspreadsheet","nodejs","browser"],"author":{"name":"Jspreadsheet Team","email":"support@jspreadsheet.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/jspreadsheet/tabularjs.git"},"bugs":{"url":"https://github.com/jspreadsheet/tabularjs/issues"},"homepage":"https://tabularjs.com","dependencies":{"@lemonadejs/html-to-json":"^1.0.0","jszip":"^3.10.1"},"devDependencies":{"c8":"^10.1.3","chai":"^6.2.1","mocha":"^11.7.5","webpack":"^5.103.0","webpack-cli":"^6.0.1","webpack-dev-server":"^5.2.2","webpack-node-externals":"^3.0.0"},"_id":"tabularjs@1.0.1","gitHead":"038891e4858eaf5976ba36c5c4cce869f6499b52","_nodeVersion":"21.4.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-mJzYi+mLHpoS2ILVcCmPnhkFKoWJurx4niY0iEQ/IDrf/M+aVLc0SCwxNoyWMhhB6447igK9HphnaMy12UHlqw==","shasum":"085c0716dc6ddd1439ace5fce8212778fe63855d","tarball":"https://registry.npmjs.org/tabularjs/-/tabularjs-1.0.1.tgz","fileCount":7,"unpackedSize":542337,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCTsRg2d33nyo4o48VvkkKJTge/6wWvLZ36hMATlgjasgIgJ1Qs5+Zf2UwuBvIjDS2RBesHXgxemvEwd/2B6uGvBbw="}]},"_npmUser":{"name":"hodeware","email":"support@jspreadsheet.com"},"directories":{},"maintainers":[{"name":"hodeware","email":"support@jspreadsheet.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tabularjs_1.0.1_1764432853142_0.7546460237689492"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-28T19:30:15.719Z","modified":"2025-11-29T16:14:13.566Z","1.0.0":"2025-11-28T19:30:15.970Z","1.0.1":"2025-11-29T16:14:13.368Z"},"bugs":{"url":"https://github.com/jspreadsheet/tabularjs/issues"},"author":{"name":"Jspreadsheet Team","email":"support@jspreadsheet.com"},"homepage":"https://tabularjs.com","keywords":["spreadsheet","parser","converter","excel","xls","xlsx","ods","opendocument","csv","tsv","lotus","wks","sylk","slk","dif","dbf","dbase","html-table","xml-spreadsheet","json","file-converter","data-import","jspreadsheet","nodejs","browser"],"repository":{"type":"git","url":"git+https://github.com/jspreadsheet/tabularjs.git"},"description":"Professional JavaScript library for converting spreadsheet files to JSON format. Supports 16+ file formats for use in Node.js and browser applications.","maintainers":[{"name":"hodeware","email":"support@jspreadsheet.com"}],"readme":"# TabularJS\n\n[![npm version](https://badge.fury.io/js/tabularjs.svg)](https://www.npmjs.com/package/tabularjs)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Tests](https://img.shields.io/badge/tests-312%20passing-brightgreen.svg)](https://github.com/jspreadsheet/tabularjs)\n\nA professional JavaScript library for converting spreadsheet files to JSON format. Supports 16+ file formats for use in Node.js and browser applications.\n\n## Features\n\n- **16+ File Formats** - Excel, OpenDocument, CSV, Lotus, SYLK, DIF, DBF, HTML tables, and more\n- **Universal JSON Output** - Structured data format for any JavaScript application\n- **Formula Preservation** - Maintains formulas where supported by the format\n- **Styling & Formatting** - Preserves merged cells, styles, and comments\n- **Zero Dependencies** - No xlsx, no SheetJS - pure JavaScript implementation\n- **Framework Agnostic** - Works with Vanilla JS, React, Vue, Angular, and Node.js\n\n## Supported Formats\n\n| Format               | Extension                              | Features                                        |\n|----------------------|----------------------------------------|-------------------------------------------------|\n| Excel 97-2003        | `.xls`                                 | ✅ Formulas, ✅ Styles, ✅ Merged cells            |\n| Excel 2007+          | `.xlsx`                                | ✅ Formulas, ✅ Styles, ✅ Merged cells            |\n| OpenDocument         | `.ods`                                 | ✅ Formulas, ✅ Styles, ✅ Merged cells            |\n| Lotus 1-2-3          | `.wks`, `.wk1`, `.wk3`, `.wk4`, `.123` | ✅ Data                                          |\n| CSV                  | `.csv`                                 | ✅ Data                                          |\n| TSV                  | `.tsv`, `.tab`                         | ✅ Data                                          |\n| Plain Text           | `.txt`                                 | ✅ Data (tab-delimited)                          |\n| XML Spreadsheet 2003 | `.xml`                                 | ✅ Formulas, ✅ Merged cells, ✅ Comments          |\n| DIF                  | `.dif`                                 | ✅ Data, ✅ Labels, ✅ Comments                    |\n| SYLK                 | `.slk`, `.sylk`                        | ✅ Formulas, ✅ Data                              |\n| dBase                | `.dbf`                                 | ✅ Data, ✅ Column types, ✅ Metadata              |\n| HTML Tables          | `.html`, `.htm`                        | ✅ Formulas, ✅ Merged cells, ✅ Styles            |\n\n## Installation\n\n```bash\nnpm install tabularjs\n```\n\n## Quick Start\n\n### Browser\n\n```javascript\nimport tabularjs from 'tabularjs';\n\n// Parse a file\nconst result = await tabularjs(fileObject);\nconsole.log(result.worksheets[0].data);\n```\n\n### Node.js\n\n```javascript\nimport tabularjs from 'tabularjs';\n\nconst result = await tabularjs('path/to/file.xlsx');\nconsole.log(result.worksheets[0].data);\n```\n\n**Command Line:**\n\n```bash\nnode src/script.js samples/test1.xml\n```\n\n**Production Script Example:**\n\n```javascript\nimport fs from 'fs';\nimport tabularjs from 'tabularjs';\n\nconst filePath = process.argv[2];\n\nif (!filePath) {\n    console.log('Usage: node script.js <path-to-file>');\n    process.exit(1);\n}\n\nif (!fs.existsSync(filePath)) {\n    console.error(`Error: File not found: ${filePath}`);\n    process.exit(1);\n}\n\ntry {\n    const result = await tabularjs(filePath);\n    console.log(JSON.stringify(result, null, 2));\n} catch (error) {\n    console.error('Error:', error.message);\n    process.exit(1);\n}\n```\n\n## Example: Integration with Jspreadsheet\n\nTabularJS is an independent file conversion tool. While it can be used with any application, here are examples showing integration with [Jspreadsheet CE](https://jspreadsheet.com) and [Jspreadsheet Pro](https://jspreadsheet.com) for creating online spreadsheets:\n\n### Vanilla JavaScript\n\n```html\n<html>\n<head>\n    <script src=\"https://cdn.jsdelivr.net/npm/jspreadsheet-ce/dist/index.min.js\"></script>\n    <link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/jspreadsheet-ce/dist/jspreadsheet.min.css\" />\n    <script src=\"https://cdn.jsdelivr.net/npm/tabularjs/dist/index.js\"></script>\n</head>\n<body>\n    <div id=\"spreadsheet\"></div>\n    <input type=\"file\" id=\"fileInput\" />\n\n    <script>\n        document.getElementById('fileInput').addEventListener('change', async (e) => {\n            const file = e.target.files[0];\n            const result = await tabularjs(file);\n\n            // TabularJS output is directly compatible with Jspreadsheet\n            jspreadsheet(document.getElementById('spreadsheet'), result);\n        });\n    </script>\n</body>\n</html>\n```\n\n### React\n\n```jsx\nimport { useRef } from 'react';\nimport jspreadsheet from 'jspreadsheet-pro';\nimport tabularjs from 'tabularjs';\n\nexport default function App() {\n    const spreadsheet = useRef(null);\n    const inputRef = useRef(null);\n\n    const load = async (e) => {\n        const file = e.target.files[0];\n        const result = await tabularjs(file);\n\n        // Create spreadsheet from imported data\n        jspreadsheet(spreadsheet.current, result);\n    };\n\n    return (\n        <>\n            <div ref={spreadsheet}></div>\n            <input\n                ref={inputRef}\n                type=\"file\"\n                onChange={load}\n                style={{ display: 'none' }}\n            />\n            <input\n                type=\"button\"\n                value=\"Load file\"\n                onClick={() => inputRef.current.click()}\n            />\n        </>\n    );\n}\n```\n\n### Vue\n\n```vue\n<template>\n    <div>\n        <div ref=\"spreadsheet\"></div>\n        <input\n            ref=\"inputRef\"\n            type=\"file\"\n            @change=\"load\"\n            style=\"display: none\"\n        />\n        <input\n            type=\"button\"\n            value=\"Load file\"\n            @click=\"$refs.inputRef.click()\"\n        />\n    </div>\n</template>\n\n<script>\nimport jspreadsheet from 'jspreadsheet-pro';\nimport tabularjs from 'tabularjs';\n\nexport default {\n    methods: {\n        async load(e) {\n            const file = e.target.files[0];\n            const result = await tabularjs(file);\n\n            // Create spreadsheet from imported data\n            jspreadsheet(this.$refs.spreadsheet, result);\n        }\n    }\n}\n</script>\n```\n\n## Formula Support\n\n| Format | Formula Support | Notes |\n|--------|----------------|-------|\n| XLS | ✅ Full | Decoded from BIFF PTG tokens |\n| XLSX | ✅ Full | Native formula strings |\n| ODS | ✅ Full | Native formula strings |\n| XML 2003 | ✅ Full | Formula attribute |\n| SYLK | ✅ Full | E parameter |\n| HTML | ✅ Partial | Via `data-formula` attribute |\n| CSV/TSV/TXT | ❌ No | Data-only format |\n| DIF | ❌ No | Data-only format (stores calculated values) |\n| DBF | ❌ No | Database format (stores calculated values) |\n| Lotus | ❌ Limited | Complex token format |\n\n## Scope & Limitations\n\nTabularJS is designed as a lightweight parser focused on data extraction and essential spreadsheet features. The following advanced features are intentionally not supported:\n\n**Not Supported:**\n- Charts and graphs\n- Pivot tables\n- Macros and VBA code\n- Images and embedded objects\n- Print settings and page breaks\n\n**Limited Support:**\n- Advanced conditional formatting\n- Complex data validations\n\nTabularJS prioritizes data, formulas, basic styling, and structural elements for web-based applications.\n\n## Testing\n\nTabularJS includes comprehensive test coverage with 312+ test cases covering all supported formats.\n\n**Run Tests:**\n\n```bash\nnpm test\n```\n\n**Test Coverage:**\n- CSV/TSV parsing with edge cases\n- Excel (.xls, .xlsx) format validation\n- OpenDocument (.ods) structure\n- Legacy formats (Lotus, SYLK, DIF, DBF)\n- HTML table parsing\n- Formula preservation\n- Style and formatting extraction\n\n## Related Tools\n\nTabularJS is part of a suite of JavaScript tools for building modern web applications:\n\n- **[Jspreadsheet](https://jspreadsheet.com)** - Lightweight JavaScript spreadsheet component\n- **[LemonadeJS](https://lemonadejs.com)** - Micro reactive JavaScript library\n- **[CalendarJS](https://calendarjs.com)** - JavaScript calendar and date picker\n\n## Technical Support\n\nFor technical support and questions, please contact: [support@jspreadsheet.com](mailto:support@jspreadsheet.com)\n\n## Links\n\n- **Website:** [tabularjs.com](https://tabularjs.com)\n- **GitHub:** [github.com/jspreadsheet/tabularjs](https://github.com/jspreadsheet/tabularjs)\n- **NPM:** `npm install tabularjs`\n\n## License\n\nMIT\n","readmeFilename":"README.md","license":"MIT"}