WebSocket-powered lightweight remote console.log() for Node.js.
npm install --save-dev console.ws
./node_modules/.bin/console
import console from 'console.ws';
console.log('Hello Console!');
I'm using for debugging of before/after hooks in WebdriverIO's config file.
In wdio.conf.js
file, the output from console.log()
is not captured and shown in the terminal.
console.ws depends on WebSocket implementation ws module, not Socket.IO.
If you're using webpack, please tweak your webpack.config.js
file
to ignore console.ws
and tls
modules because Webpack can't handle some native modules correctly.
Here is the error detail.
ERROR in ./~/ws/lib/WebSocketServer.js
Module not found: Error: Cannot resolve module 'tls' in /path/to/project/node_modules/ws/lib
@ ./~/ws/lib/WebSocketServer.js 15:10-24
You can't use console.ws on browsers. The both client and server must be run on Node.js.
Note: Not enough compatibility with Console API
Yuki Kodama / @kuy
MIT