1.0.0 • Published 5 years ago

node-console-assert v1.0.0

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

node-console-assert

console.assert polyfill for node environment, make it work like browser's console.assert

Usage

console.assert = require('node-console-assert');

console.assert(1 + 2 === 3, '1 + 2 must equal 3'); // no error

function addition(a, b) {
    return a * b;
};
console.assert(addition(2, 3) === 5, '2 + 3 must equal 5'); // error

If you don't want to modify the global console.assert, you can assign to a new constant.

const consoleAssert = require('node-console-assert');

Check more examples in test.js file.

Development

BranchStatus
masterBuild Status

License

2019 © Ezzat Chamudi

The code is released under MIT License