Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including socketwatcher with all npm packages installed. Try it out:

var socketwatcher = require("socketwatcher")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

socketwatcher v0.3.0

Binding for uv_poll and replacement for IOWatcher


SocketWatcher is a JavaScript binding for uv_poll based on code by TobyEalden (with permission) for node_mdns. It's useful as a drop-in replacement for Node's old, private module IOWatcher.

More information on uv_poll:

##Installation and use

$ npm install socketwatcher

var SocketWatcher = require("socketwatcher").SocketWatcher;
var watcher = new SocketWatcher();
watcher.callback = function() { [...] };
watcher.set(fd, read_flag, write_flag);
// watcher.stop();

Note: since version 0.2.0, you must use require("socketwatcher").SocketWatcher, instead of using the module object directly. Sorry for the inconvenience.

##Original work

The files contributed to node_mdns:


MIT licensed, see LICENSE.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free