lug

0.1.0 • Public • Published

lug

functional console logging

usage

var lug = require('lug')
lug('foo')
// console:
//   foo
// => 'foo'

[1,2,3].map(lug.label('Num'))
// console:
//   Num: 1 0 [ 1, 2, 3 ]
//   Num: 2 1 [ 1, 2, 3 ]
//   Num: 3 2 [ 1, 2, 3 ]
// => [1,2,3]

api

lug(...Value) => Value

Has the same logging behavior as console.log, but does not rely on a specific this value, and returns the first argument. This means you can pass it to Array.prototype.map, for example, to peek into the value.

lug.label(String) => (...Value) => Value

A factory function to create an instance of lug that prefixes logged output with a label.

installation

$ npm install lug

running the tests

From package root:

$ npm install
$ npm test

contributors

license

MIT. (c) 2013 jden jason@denizac.org. See LICENSE.md

Readme

Keywords

Package Sidebar

Install

npm i lug

Weekly Downloads

0

Version

0.1.0

License

MIT

Last publish

Collaborators