node-console-assert
v1.0.0
Published
console.assert polyfill for node environment, make it work like browser's console.assert
Downloads
2
Readme
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
| Branch | Status | | - | - | | master | |
License
2019 © Ezzat Chamudi
The code is released under MIT License