0.1.0 • Published 9 years ago

console-var v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

console-var

Node.js package to store console.log output in a variable.

General idea

When you pass a function to console-var it executes your function and returns what the function was logging.

This allows parsing the log right after function execution, testing what the function is logging, or redirecting the log to another stream.

Installation

npm install console-var --save

Usage

var cvar = require('console-var');

function logHello () {
    console.log("Hello World!");
}

var consoleOutput = cvar(logHello);

Coming-soon improvements

  • option to return logs in different formats
  • option to capture console.err
  • return function log alongside its regular return value
  • ability to pass in more than one function
  • in-browser console log support

    Stay tuned!

License

MIT

0.1.0

9 years ago

0.0.1

9 years ago