{"id":14088,"library":"table-js","title":"table-js: Fast Table Viewer & Editor","description":"table-js is a high-performance JavaScript library designed for efficiently viewing and editing tabular data. It leverages ES modules exclusively, meaning consumers must use a module-aware bundler like Webpack or Rollup for browser environments, as it does not ship pre-built artifacts. The current stable version is 9.4.0, with minor and patch releases occurring frequently, typically driven by dependency updates or internal chore tasks. Its key differentiator is its focus on speed and its integration within the bpmn.io ecosystem, often used alongside `diagram-js` and `inferno` for rich web applications requiring structured data display and interaction.","status":"active","version":"9.4.0","language":"javascript","source_language":"en","source_url":"https://github.com/bpmn-io/table-js","tags":["javascript"],"install":[{"cmd":"npm install table-js","lang":"bash","label":"npm"},{"cmd":"yarn add table-js","lang":"bash","label":"yarn"},{"cmd":"pnpm add table-js","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Rendering engine, specified as a peer dependency.","package":"inferno","optional":false},{"reason":"Core library for rendering and interaction, specified as a peer dependency.","package":"diagram-js","optional":false}],"imports":[{"note":"The library is ES module-only. CommonJS `require` will not work. Some specific features might be named exports.","wrong":"const Table = require('table-js');","symbol":"Table","correct":"import Table from 'table-js';"},{"note":"Assuming a named export for a specific component. Direct import paths to `lib` are typically internal and unstable.","wrong":"import TableViewer from 'table-js/lib/TableViewer';","symbol":"TableViewer","correct":"import { TableViewer } from 'table-js';"},{"note":"For ESM, always use `import` statements. Named exports are common for utilities or specific components.","wrong":"const TableEditor = require('table-js').TableEditor;","symbol":"TableEditor","correct":"import { TableEditor } from 'table-js';"}],"quickstart":{"code":"import Table from 'table-js';\nimport { render } from 'inferno';\n\n// Minimal Inferno setup (peer dependency)\nconst InfernoContainer = ({ children }) => <div>{children}</div>;\n\n// Assume a basic table configuration and data structure\nconst tableConfig = {\n  container: document.querySelector('#table-container'),\n  data: [\n    { id: 'row1', cells: [{ id: 'cell1-1', content: 'Header A' }, { id: 'cell1-2', content: 'Value X' }] },\n    { id: 'row2', cells: [{ id: 'cell2-1', content: 'Header B' }, { id: 'cell2-2', content: 'Value Y' }] }\n  ],\n  columns: [\n    { id: 'col1', width: 150 },\n    { id: 'col2', width: 200 }\n  ]\n};\n\nfunction initializeTable() {\n  const container = document.createElement('div');\n  container.id = 'table-container';\n  document.body.appendChild(container);\n\n  const table = new Table(tableConfig);\n  table.render();\n  console.log('Table initialized and rendered.');\n\n  // Example of interaction (assuming API)\n  // table.on('cell.select', (event) => {\n  //   console.log('Cell selected:', event.element);\n  // });\n}\n\n// You would typically mount your Inferno application\n// and integrate table-js within an Inferno component.\n// For a quickstart, we just attach it to a raw DOM element.\n\ndocument.addEventListener('DOMContentLoaded', initializeTable);","lang":"typescript","description":"Demonstrates basic setup of a table-js instance by creating a container and rendering a simple table using a minimal configuration. It implicitly accounts for Inferno as a peer dependency."},"warnings":[{"fix":"Check the `peerDependencies` range for `diagram-js` in `package.json` and ensure your installed `diagram-js` version falls within that range. Upgrade `diagram-js` if necessary.","message":"Major versions of `diagram-js` (a peer dependency) are frequently updated, requiring consumers to ensure compatibility with their `diagram-js` installation. For example, v9.2.0 updated `diagram-js` to v15.","severity":"breaking","affected_versions":">=9.1.0"},{"fix":"Always use ES module `import` syntax. If targeting browsers, use an ES module-aware bundler (e.g., Webpack, Rollup, Vite). For Node.js, ensure your project is configured for ESM (e.g., `\"type\": \"module\"` in `package.json`).","message":"The library exclusively uses ES modules. Direct `require()` statements will result in runtime errors, particularly in Node.js environments without ES module resolution or older build setups.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Integrate `table-js` into your existing build pipeline using a bundler (Webpack, Rollup, Parcel). Configure the bundler to resolve ES modules and process any necessary assets.","message":"This library does not provide pre-built artifacts. Consumers are responsible for bundling the library themselves, which can add complexity to build configurations, especially for projects not already using a bundler.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure your development and production environments run a Node.js version compatible with the latest `table-js` release. Check the `engines.node` field in `package.json`.","message":"Minimum supported Node.js versions may increase with minor releases. For instance, v9.4.0 updated its CI to use Node.js 24.","severity":"breaking","affected_versions":">=9.4.0"}],"env_vars":null,"search_vec":"'9.4.0':61 'alongsid':95 'applic':104 'artifact':55 'awar':38 'bpmn.io':91 'browser':45 'built':54 'bundler':39 'chore':76 'consum':32 'current':57 'data':25,107 'depend':72 'design':18 'diagram':97 'diagram-j':96 'differenti':80 'display':108 'driven':70 'ecosystem':92 'edit':23 'editor':7 'effici':20 'environ':46 'es':28 'exclus':30 'fast':4 'focus':83 'frequent':68 'high':14 'high-perform':13 'inferno':100 'integr':88 'interact':110 'intern':75 'javascript':16,111 'js':3,10,98 'key':79 'leverag':27 'librari':17 'like':40 'mean':31 'minor':63 'modul':29,37 'module-awar':36 'must':33 'occur':67 'often':93 'patch':65 'perform':15 'pre':53 'pre-built':52 'releas':66 'requir':105 'rich':102 'rollup':43 'ship':51 'speed':85 'stabl':58 'structur':106 'tabl':2,5,9 'table-j':1,8 'tabular':24 'task':77 'typic':69 'updat':73 'use':34,94 'version':59 'view':21 'viewer':6 'web':103 'webpack':41 'within':89","created_at":"2026-04-20T01:57:51.638220+00:00","updated_at":"2026-04-20T01:57:51.638220+00:00","problems":[{"fix":"Change `const Table = require('table-js');` to `import Table from 'table-js';` (or `import { NamedExport } from 'table-js';`). Ensure your Node.js project or bundler is set up for ES Modules.","cause":"Attempting to import `table-js` using CommonJS `require()` syntax in a Node.js environment or a build process not configured for ESM.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module ... from ... not supported."},{"fix":"Install the peer dependencies: `npm install inferno@^5 diagram-js@^15` (adjust versions to match the peer dependency range specified by `table-js`).","cause":"The required peer dependencies `inferno` and/or `diagram-js` are not installed alongside `table-js`.","error":"Cannot find module 'inferno' or 'diagram-js'"},{"fix":"Use an ES module-aware bundler (e.g., Webpack, Rollup, Parcel) to bundle `table-js` and its dependencies for the browser. Configure your `script` tag with `type=\"module\"` if using native ES modules and not bundling, though bundling is recommended for production.","cause":"Attempting to run `table-js` directly in a browser without a build step that processes ES Modules.","error":"Uncaught SyntaxError: Cannot use import statement outside a module"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":"https://bpmn.io","github":"https://github.com/bpmn-io/table-js","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/table-js","openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-18","install_tag":null}}