{"id":14955,"library":"table-parser-base","title":"Table Parser Base Utilities","description":"table-parser-base is a lightweight JavaScript utility library designed to facilitate the transformation of tabular data structures. Primarily, it offers functions to convert between an `ArrayTable` format (an object with separate `headers` and `rows` arrays) and an `ObjectTable` format (an array of objects, where each object represents a row). Currently at version 0.0.5, the package is in a very early stage of development, implying an ad-hoc release cadence without a fixed schedule and potential for rapid iteration on its API. Its core differentiation lies in providing simple, focused, and stream-capable utilities for these specific table data model conversions, often serving as foundational components for broader data parsing or manipulation pipelines. It emphasizes an asynchronous, iterable approach for processing object tables, which is suitable for potentially large datasets.","status":"active","version":"0.0.5","language":"javascript","source_language":"en","source_url":"https://github.com/ksxnodeapps/fun-little-utilities","tags":["javascript"],"install":[{"cmd":"npm install table-parser-base","lang":"bash","label":"npm"},{"cmd":"yarn add table-parser-base","lang":"bash","label":"yarn"},{"cmd":"pnpm add table-parser-base","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is ESM-only and requires `import` statements. For dynamic loading or older Node.js versions, `await import()` within an async context is necessary.","wrong":"const { createObjectTable } = require('table-parser-base')","symbol":"createObjectTable","correct":"import { createObjectTable } from 'table-parser-base'"},{"note":"Ensure your environment supports ES Modules. Direct CommonJS `require()` is not supported.","wrong":"const createArrayTable = require('table-parser-base').createArrayTable","symbol":"createArrayTable","correct":"import { createArrayTable } from 'table-parser-base'"}],"quickstart":{"code":"import { createObjectTable } from 'table-parser-base'\n\nconst arrayTable = {\n  headers: ['id', 'name', 'email'],\n  rows: [\n    [1, 'John Doe', 'john-doe@gmail.com'],\n    [2, 'Peter Smith', 'petersmith22@outlook.com'],\n    [3, 'Julia Jones', 'jjones778@gmail.com']\n  ]\n}\n\nasync function processTable() {\n  const objectTable = await createObjectTable(arrayTable)\n  console.log('--- Converted to ObjectTable ---')\n  for await (const item of objectTable) {\n    console.log(item)\n  }\n}\n\nprocessTable()\n","lang":"javascript","description":"This quickstart demonstrates how to import and use `createObjectTable` to transform an array-based table structure into an iterable object-based table, logging each row."},"warnings":[{"fix":"Always review the package's changelog or GitHub repository for breaking changes between versions. It is recommended to pin exact versions (`0.0.x`) in your `package.json` to avoid unexpected updates.","message":"As a pre-1.0.0 package (version 0.0.5), `table-parser-base` does not adhere to semantic versioning strictly. Any minor or patch release can introduce breaking changes without prior notice, leading to unexpected behavior or API shifts.","severity":"breaking","affected_versions":">=0.0.1"},{"fix":"Ensure your project is configured for ES Modules by setting `\"type\": \"module\"` in your `package.json` or by using `.mjs` file extensions. Use `import` statements exclusively.","message":"This package is exclusively designed for ES Module (ESM) environments. Attempting to use it with CommonJS `require()` syntax will result in errors.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Thoroughly test your application when upgrading `table-parser-base` to any new version, even minor ones. Be prepared for potential refactoring if API changes are introduced.","message":"The API surface of `table-parser-base` is considered volatile due to its early development stage. Function signatures, names, or overall structure might change in future versions without extensive deprecation cycles.","severity":"gotcha","affected_versions":"<=0.x.x"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Configure your project to use ES Modules by adding `\"type\": \"module\"` to your `package.json` file, or ensure the file containing the import is named with a `.mjs` extension. Alternatively, run Node.js with `--input-type=module`.","cause":"You are attempting to use an ES Module `import` statement in a CommonJS context (e.g., a `.js` file without `\"type\": \"module\"` in `package.json` or a `.cjs` file).","error":"SyntaxError: Cannot use import statement outside a module"},{"fix":"Verify that `import { createObjectTable } from 'table-parser-base'` is correctly written. If using dynamic imports, ensure it's `const { createObjectTable } = await import('table-parser-base')` within an `async` function or at the top level of an ES Module.","cause":"This usually indicates an incorrect import, a misspelling, or attempting to destructure from the `require()` call which is not supported for ESM-only packages, or not `await`ing the dynamic import.","error":"TypeError: createObjectTable is not a function"}],"ecosystem":"npm"}