Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/echamudi/node-console-assert
console.assert polyfill for node environment, make it work like browser's console.assert
https://github.com/echamudi/node-console-assert
Last synced: 4 days ago
JSON representation
console.assert polyfill for node environment, make it work like browser's console.assert
- Host: GitHub
- URL: https://github.com/echamudi/node-console-assert
- Owner: echamudi
- License: mit
- Created: 2019-10-20T16:20:35.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T18:54:18.000Z (about 2 years ago)
- Last Synced: 2024-04-29T00:24:12.416Z (9 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/node-console-assert
- Size: 26.4 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# node-console-assert
console.assert polyfill for node environment, make it work like browser's console.assert
## Usage
```js
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.
```js
const consoleAssert = require('node-console-assert');
```Check more examples in [test.js](https://github.com/echamudi/node-console-assert/blob/master/test.js) file.
## Development
| Branch | Status |
| - | - |
| master | [![Build Status](https://travis-ci.org/echamudi/node-console-assert.svg?branch=master)](https://travis-ci.org/echamudi/node-console-assert) |## License
2019 © [Ezzat Chamudi](https://github.com/echamudi)
The code is released under [MIT License](https://opensource.org/licenses/MIT)