0.4.0 • Published 8 years ago

clean-console v0.4.0

Weekly downloads
8
License
MIT
Repository
github
Last release
8 years ago

clean-console

Quickly loads a remote page using phantomjs to check if there are any JavaScript console errors.

NPM

Build status dependencies devdependencies semantic-release

Install and use

npm install -g clean-console
// assumes phantomjs is installed
clean-console -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);
    }
}

Update

Seems the latest PhantomJs 2 generates errors when using console.error and console.assert by default.

Small print

Author: Gleb Bahmutov © 2013

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 / tweet / open issue on Github

0.4.0

8 years ago

0.3.0

9 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago

0.0.0

11 years ago