obj-console
Beautify terminal output of JS-objects with VSCode colors and custom format. 10K dist with no dependencies.
You can tune output to enhance readability of single objects or arrays. Or print compact brief of data just to understand, that data has appropriate form. For example, options: {unfoldDepth: 1, omitBrackets: true, omitEolCommas: true, quote: "", align: true} leads to output:


Usage
import { objConsole, objFormat } from 'obj-console';
objConsole(someData);
objConsole(someData, options);
const str = objFormat(someData);
console.log(str);
Options
interface FormatOptions {
omitBrackets?: boolean;
omitEolCommas?: boolean;
quote?: "" | "'" | "\"";
keyQuote?: "" | "'" | "\"";
maxArrayLength?: number;
maxStringLength?: number;
maxDepth?: number;
padding?: string;
align?: boolean;
unfoldDepth?: number;
}
Predefined options
import { objConsole, BRIEF } from 'obj-console';
objConsole(someData, BRIEF);
- COMPACT
- BRIEF
- ONE_LINE
- AS_JSON
- COLUMNS
