0.1.3 • Published 7 years ago

preview v0.1.3

Weekly downloads
35
License
MIT
Repository
github
Last release
7 years ago

Preview

build status

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 printing on or off using --preview argument.

Installation

From your terminal, requires node.js.

npm install preview

Module

require('preview')(<namespace>, {options});
preview(<namespace>, <text>, <object>);

Objects supported: {}, [], Number, Buffer, Date, Boolean

Example

var preview = require('preview')('app1');

var foo = {bar: 8211, hello: 'world', list: [1,2,3]};   // some object to inspect.

preview('foo');
preview('foo object', foo);
preview('app2', 'foo.bar: ' + foo.bar);
preview('foo foo from app1 again');

To run preview, use the --preview argument:

node example.js --preview

npm.io

Namespaces

Can print just a specific namespace or a list of namespaces.

node example.js --preview=app1
node example.js --preview="app1, app2"

Options

{
  inverse: true   // inverse the background color.
}

License

Choose either: MIT or Apache 2.0.

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago