{"_id":"@bybrave/columnify2","name":"@bybrave/columnify2","dist-tags":{"latest":"2.0.0"},"versions":{"2.0.0":{"name":"@bybrave/columnify2","version":"2.0.0","description":"Maintained fork of columnify — create text columns for the console. Zero dependencies (ReDoS advisory fixed), dual ESM + CJS, built-in TypeScript types","main":"lib/columnify.js","types":"index.d.ts","exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./lib/columnify.js"},"./package.json":"./package.json"},"scripts":{"test":"node --test test/*.test.js","test-types":"tsc --noEmit --strict test/type-declarations.ts"},"repository":{"type":"git","url":"git+https://github.com/bybraveHQ/columnify2.git"},"bugs":{"url":"https://github.com/bybraveHQ/columnify2/issues"},"homepage":"https://github.com/bybraveHQ/columnify2#readme","keywords":["columns","text","ansi","console","terminal","cli","table","format","columnify","wcwidth","typescript","esm"],"author":{"name":"bybrave","url":"https://github.com/bybraveHQ"},"contributors":[{"name":"Tim Oxley","url":"author of the original columnify"}],"license":"MIT","funding":"https://ko-fi.com/bybrave","engines":{"node":">=18"},"devDependencies":{"@types/node":"^20.14.0","typescript":"^5.5.0"},"_id":"@bybrave/columnify2@2.0.0","gitHead":"755469f4d55cec8b52e58320ad8a5f2652b01d55","_nodeVersion":"20.19.6","_npmVersion":"10.8.2","dist":{"integrity":"sha512-5nUTeIxRV8L1cQnqXx43zF+1ePI1gc8mIa22SAwaL3lVX6kcg3BNNPvq5lH+CYFWUjB292KNNj0vRUy//HeNjA==","shasum":"3a512f9fc799a7b2878d76de74eb40c3499f2f10","tarball":"https://registry.npmjs.org/@bybrave/columnify2/-/columnify2-2.0.0.tgz","fileCount":10,"unpackedSize":32154,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCHMseZQLLXhFRHjhPlBlp8ICZdNpjivIwzpiw7KRxhLQIhAK5BkMj8/HzlNa7zcJSuzCqrE2sSaC2mcq9cY7ZwjE0L"}]},"_npmUser":{"name":"bybrave","email":"opmybrave@gmail.com"},"directories":{},"maintainers":[{"name":"bybrave","email":"opmybrave@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/columnify2_2.0.0_1783338220274_0.2205659557573718"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-06T11:43:40.092Z","2.0.0":"2026-07-06T11:43:40.407Z","modified":"2026-07-06T11:43:40.621Z"},"maintainers":[{"name":"bybrave","email":"opmybrave@gmail.com"}],"description":"Maintained fork of columnify — create text columns for the console. Zero dependencies (ReDoS advisory fixed), dual ESM + CJS, built-in TypeScript types","homepage":"https://github.com/bybraveHQ/columnify2#readme","keywords":["columns","text","ansi","console","terminal","cli","table","format","columnify","wcwidth","typescript","esm"],"repository":{"type":"git","url":"git+https://github.com/bybraveHQ/columnify2.git"},"contributors":[{"name":"Tim Oxley","url":"author of the original columnify"}],"author":{"name":"bybrave","url":"https://github.com/bybraveHQ"},"bugs":{"url":"https://github.com/bybraveHQ/columnify2/issues"},"license":"MIT","readme":"# @bybrave/columnify2\n\nA maintained, drop-in fork of [`columnify`](https://www.npmjs.com/package/columnify) — create text-based columns suitable for console output from objects or arrays of objects. Automatically resizes columns to fit their content, and supports word wrapping, truncation, alignment, per-column configuration and ANSI colors.\n\nThe original `columnify` has been unmaintained since 2023. This fork keeps its exact output (verified byte-for-byte against the upstream test fixtures) while modernizing the packaging and fixing the most-requested bugs.\n\n```bash\nnpm install @bybrave/columnify2\n```\n\n## Why this fork\n\n| Feature | `columnify` | `@bybrave/columnify2` |\n|---|---|---|\n| Runtime dependencies | 2 (`wcwidth`, `strip-ansi`) | **0** — everything vendored |\n| ReDoS advisory (via `ansi-regex`) | flagged by `npm audit` | **gone** — no dependency tree |\n| Module formats | CommonJS only | **ESM + CommonJS** (dual) |\n| TypeScript types | separate `@types/columnify` | **built-in** `index.d.ts` |\n| Output compatibility | — | **byte-for-byte identical** |\n\n## Fixes\n\n| Issue | Problem | Fix |\n|---|---|---|\n| [#61](https://github.com/timoxley/columnify/issues/61) | `strip-ansi`/`ansi-regex` pulled in a ReDoS-vulnerable dependency; `npm audit` complained whenever columnify was a transitive dep | Vendored `wcwidth`, `strip-ansi` and `ansi-regex@5` into `lib/` → **zero dependencies**, the advisory disappears with the tree |\n| [#64](https://github.com/timoxley/columnify/issues/64) | The options object was mutated in place (`delete options.config`), throwing on a frozen object and surprising callers who reused it | Work on a private copy; the caller's object is never touched |\n| [#58](https://github.com/timoxley/columnify/issues/58) | No bundled TypeScript types; needed the separate `@types/columnify` | Ships a hand-written `index.d.ts` |\n| [#52](https://github.com/timoxley/columnify/issues/52) | `RangeError: Maximum call stack size exceeded` on very wide columns (e.g. `maxWidth: Infinity` on long content) | Padding no longer uses `Array.apply`; built with `String.repeat`, which has no stack limit |\n| [#47](https://github.com/timoxley/columnify/issues/47) | Per-column `paddingChr` in `config` was ignored; only the global value worked | Padding character is now read per column, falling back to the global value |\n| [#17](https://github.com/timoxley/columnify/issues/17) | An ANSI-styled or wide padding char (e.g. `chalk.gray('.')`) was chopped mid-escape-sequence | Padding is measured by visual width and whole padding tokens are repeated, never sliced |\n\n## Usage\n\n```js\nconst columnify = require('@bybrave/columnify2')\n// or, ESM:\nimport columnify from '@bybrave/columnify2'\n\nconst columns = columnify([{\n  name: 'mod1',\n  description: 'some description',\n  version: '0.0.1',\n}, {\n  name: 'module-two',\n  description: 'another description',\n  version: '0.2.0',\n}])\n\nconsole.log(columns)\n```\n\n```\nNAME       DESCRIPTION         VERSION\nmod1       some description    0.0.1\nmodule-two another description 0.2.0\n```\n\nPass a plain object to render key/value rows:\n\n```js\ncolumnify({ 'commander@2.0.0': 34, 'debug@0.7.4': 47 })\n```\n\n### Options\n\nGlobal options (also usable per-column via `config`):\n\n| Option | Default | Description |\n|---|---|---|\n| `maxWidth` | `Infinity` | Maximum column width; longer content wraps or truncates |\n| `minWidth` | `0` | Minimum column width |\n| `truncate` | `false` | Truncate instead of wrapping |\n| `truncateMarker` | `'…'` | Marker appended to truncated content |\n| `align` | `'left'` | `'left'` \\| `'right'` \\| `'center'` |\n| `paddingChr` | `' '` | Character used to pad cells (per-column aware) |\n| `preserveNewLines` | `false` | Keep existing newlines within a cell |\n| `showHeaders` | `true` | Show column headers |\n| `headingTransform` | `UPPERCASE` | Transform applied to each heading |\n| `dataTransform` | identity | Transform applied to each data cell |\n\nTop-level only:\n\n| Option | Default | Description |\n|---|---|---|\n| `columns` / `include` | all keys | Ordered subset of columns to render |\n| `columnSplitter` | `' '` | String between columns |\n| `maxLineWidth` | `Infinity` | Wrap whole output to width; `'auto'` uses `process.stdout.columns` |\n| `config` | `{}` | Per-column option overrides, keyed by column name |\n\nSee the [original documentation](https://github.com/timoxley/columnify#documentation) for full details — the API is unchanged.\n\n## Migration\n\n`@bybrave/columnify2` is a drop-in replacement. The public API and output are identical.\n\n```diff\n- const columnify = require('columnify')\n+ const columnify = require('@bybrave/columnify2')\n```\n\nIf you had `@types/columnify` installed only for columnify, you can remove it — types are now built in.\n\n```bash\nnpm uninstall columnify @types/columnify\nnpm install @bybrave/columnify2\n```\n\n## Known limitations (by design)\n\nThese match upstream behavior and are intentionally left unchanged to preserve compatibility:\n\n- **Whitespace is collapsed** ([#45](https://github.com/timoxley/columnify/issues/45), [#37](https://github.com/timoxley/columnify/issues/37)) — all whitespace within a cell is merged to single spaces (use `preserveNewLines` to keep newlines). Preserving arbitrary whitespace would change the output of existing users.\n- **Wrapping is not ANSI-aware across line breaks** ([#26](https://github.com/timoxley/columnify/issues/26)) — when a colored string wraps onto multiple lines, the escape codes are not re-applied per line. ANSI width is still measured correctly for column sizing.\n\n## Support\n\nIf this package saves you time, you can support maintenance:\n\n[![Ko-fi](https://img.shields.io/badge/Ko--fi-buy%20me%20a%20coffee-FF5E5B?logo=kofi&logoColor=white)](https://ko-fi.com/bybrave)\n[![Bitcoin](https://img.shields.io/badge/Bitcoin-BTC-F7931A?logo=bitcoin&logoColor=white)](#support)\n\nBitcoin (BTC): `bc1q37557q5jpeaxqydzwvf3jgj7zhnfpn2td3q40q`\n\n## License\n\nMIT © [Tim Oxley](https://github.com/timoxley) (original columnify), © bybrave (columnify2 fork).\n","readmeFilename":"README.md","_rev":"1-06e5d0abe8d25775a9a91c681ccb5fc3"}