Console logging, inspecting and debugging tool.
Instead of having console.log and util.inspect all over your code during development, use preview and can then turn object printing on or off using --preview argument.
Simpler than Preview.
From your terminal, requires node.js.
npm install preview2
In TypeScript.
/// <reference types="@types/node" />
//
// ts-node example.ts --preview
//
import { preview, Log } from 'preview2';
const log: Log = preview(__filename);
log('will always print', undefined, true);
let foo: any = {bar: 8211, hello: 'world', list: [1,2,3]}; // some object to inspect.
log('foo');
log('foo object', foo);
log(foo);
Run:
ts-node example.ts --preview
Choose either: MIT or Apache 2.0.