You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This works: node -e 'T=require("tty-table"); console.log(T([["a","b"]]).render())'
This now throws exception: node -e 'T=require("tty-table"); console.log(T([["a","b"]]).render())' >/tmp/test.txt
Expected Result (screen shot if possible)
A reasonable table rendering
Should treat width as infinite (fit content) unless % columns are uses, then a reasonable default like 100 should be used.
Actual Result (screen shot if possible)
node -e 'T=require("tty-table"); console.log(T([["a","b"]]).render())' >/tmp/test.txt
.../node_modules/tty-table/src/format.js:70
throw new Error("Cannot auto discover available table width. Set table `width` option or export the environment variable COLUMNS")
^
Error: Cannot auto discover available table width. Set table `width` option or export the environment variable COLUMNS
at getAvailableWidth (.../node_modules/tty-table/src/format.js:70:9)
at Object.module.exports.getColumnWidths (.../node_modules/tty-table/src/format.js:207:26)
at Object.module.exports.stringifyData (.../node_modules/tty-table/src/render.js:31:78)
at Array.Factory.tableObject.render (.../node_modules/tty-table/src/factory.js:121:27)
at [eval]:1:52
at Script.runInThisContext (vm.js:116:20)
at Object.runInThisContext (vm.js:306:38)
at Object.<anonymous> ([eval]-wrapper:9:26)
at Module._compile (internal/modules/cjs/loader.js:956:30)
at evalScript (internal/process/execution.js:80:25)
Problem Summary
getAvailableWidth()
should work without a widthThis works:
node -e 'T=require("tty-table"); console.log(T([["a","b"]]).render())'
This now throws exception:
node -e 'T=require("tty-table"); console.log(T([["a","b"]]).render())' >/tmp/test.txt
Expected Result (screen shot if possible)
A reasonable table rendering
Should treat width as infinite (fit content) unless % columns are uses, then a reasonable default like 100 should be used.
Actual Result (screen shot if possible)
Environment Information
OS: Mac
Terminal Emulator: iTerm
Steps to Reproduce
node -e 'T=require("tty-table"); console.log(T([["a","b"]]).render())' >/tmp/test.txt
The text was updated successfully, but these errors were encountered: