0.0.6 • Published 10 years ago

read_browser_console v0.0.6

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

read_browser_console

Quickly loads a remote page using phantomjs to check if there are any JavaScript console errors.Finally the promise returns the console data. This is a copy (and a few added lines) of Gleb Bahmutov's clean-console.(https://www.npmjs.org/package/clean-console) All credits goes to him.

Install and use

npm install -g read_browser_console
// assumes phantomjs is installed
read_browser_code -i <url>

Note: only actual exceptions will be logged, failed console.assert statements DO NOT cause a true browser error (unlike nodejs).

A good pattern to unify nodejs/browser assertion handling is to wrap assertions into helper method:

function really(condition, message) {
    console.assert(condition, message); // stops nodejs execution
    if (!condition) {
        // stop execution in a browser
        throw new Error(condition.toString() + ' failed, ' + message);
    }
}

Small print

Author: Laszlo Pap © 2014

License: MIT - do anything with the code, but don't blame me if it does not work.

Support: if you find any problems with this module, email / open issue on Github

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

0.2.5

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago