preview2
TypeScript icon, indicating that this package has built-in type declarations

0.2.6 • Public • Published

Preview2

build status NPM version node version

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.

Installation

From your terminal, requires node.js.

npm install preview2

Example

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

License

Choose either: MIT or Apache 2.0.

Package Sidebar

Install

npm i preview2

Weekly Downloads

0

Version

0.2.6

License

MIT

Unpacked Size

7.81 kB

Total Files

11

Last publish

Collaborators

  • fluidecho