Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/qfox/console-assert
Standardizer for node's console.assert
https://github.com/qfox/console-assert
Last synced: 23 days ago
JSON representation
Standardizer for node's console.assert
- Host: GitHub
- URL: https://github.com/qfox/console-assert
- Owner: qfox
- Created: 2016-03-24T21:22:15.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-03-24T21:41:15.000Z (over 8 years ago)
- Last Synced: 2024-10-02T12:19:29.763Z (about 1 month ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# console-assert
Simple `console.assert` polyfill for node since existing realization throws instead of printing error.
See:
- Issue in nodejs repository: https://github.com/nodejs/node/issues/5340
- Draft specification: https://github.com/DeveloperToolsWG/console-object/blob/master/api.md#consoleassertexpression-object## Why?
Because when you trying to write polymorphic code you can't use console.assert in node env.
## How to use?
Install module via npm:
```
npm i console-assert
```Write this somewhere when you need it:
```js
require('console-assert').browserify();
```> NB: Module patchs global console.assert and if you need to rollback behaviour
you have to just run `require('console-assert').restore();`.## License
[The MIT License](http://qfox.mit-license.org/)