{"_id":"shet-client","_rev":"31-5aec1ebc85a353ebb41be6375e0bcdf5","name":"shet-client","description":"SHET client","dist-tags":{"latest":"0.3.1"},"versions":{"0.0.0":{"name":"shet-client","description":"SHET client","version":"0.0.0","homepage":"https://github.com/18sg/node-shet-client","repository":{"type":"git","url":"git://github.com/18sg/node-shet-client.git"},"author":{"name":"Thomas Nixon","email":"tom@tomn.co.uk","url":"http://tomn.co.uk"},"main":"lib/shet","directories":{"lib":"lib"},"engines":{"node":"*"},"dependencies":{"q":"*","recon":"*","lines-adaptor":"*"},"_npmUser":{"name":"tomn","email":"tom@tomn.co.uk"},"_id":"shet-client@0.0.0","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"779b0b07c857cbf771d27f6cdf3d687df332e8d9","tarball":"https://registry.npmjs.org/shet-client/-/shet-client-0.0.0.tgz","integrity":"sha512-NM1lE8wPAfb+eST8C8r02qkFkjKjO1xBakFOvpeLAwx1Ce+T8T6sSscqtJTqnsrCYyj5nSUPnLnhvqkvN1ZTuQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMmtG4sZHYjplqJSJW3EpVYsTLie7W3i5CR0ZZuB5quAIhAI80x3oI1b0PZivXeuRvM94zI8iq7xqVwkyMDxVc5X5A"}]},"maintainers":[{"name":"tomn","email":"tom@tomn.co.uk"}]},"0.0.1":{"name":"shet-client","description":"SHET client","version":"0.0.1","homepage":"https://github.com/18sg/node-shet-client","repository":{"type":"git","url":"git://github.com/18sg/node-shet-client.git"},"author":{"name":"Thomas Nixon","email":"tom@tomn.co.uk","url":"http://tomn.co.uk"},"main":"lib/shet","directories":{"lib":"lib"},"engines":{"node":"*"},"dependencies":{"q":"*","recon":"*","lines-adaptor":"*"},"_npmUser":{"name":"tomn","email":"tom@tomn.co.uk"},"_id":"shet-client@0.0.1","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"431e366aa101050f3f99d40aaacbe7cc8a1fc59f","tarball":"https://registry.npmjs.org/shet-client/-/shet-client-0.0.1.tgz","integrity":"sha512-7OPDLP5J54ljCIb14jcTsZDLE+2etCM2vOy3g5KOF10jUKlFMLV0Kxdi+XKwVEv+VstpZtbgiMl0H1npLSvdxg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD0y6TwVNf98SI/ECz8syR76aBko233lO5UMHFmVR0SaAIhAOuamccOqjwkR3ybnutpZvgHdDpLmRKFHDkN2tdqtIVe"}]},"maintainers":[{"name":"tomn","email":"tom@tomn.co.uk"}]},"0.0.2":{"name":"shet-client","description":"SHET client","version":"0.0.2","homepage":"https://github.com/18sg/node-shet-client","repository":{"type":"git","url":"git://github.com/18sg/node-shet-client.git"},"author":{"name":"Thomas Nixon","email":"tom@tomn.co.uk","url":"http://tomn.co.uk"},"main":"lib/shet","directories":{"lib":"lib"},"engines":{"node":"*"},"dependencies":{"q":"*","recon":"*","lines-adapter":"*"},"_npmUser":{"name":"tomn","email":"tom@tomn.co.uk"},"_id":"shet-client@0.0.2","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.6.0","_defaultsLoaded":true,"dist":{"shasum":"0619f0216d04c3b0c7ef92dc50860b566a35d762","tarball":"https://registry.npmjs.org/shet-client/-/shet-client-0.0.2.tgz","integrity":"sha512-5tkom1zGtNcYbDGWvZbQ5/YSgNqzDTixAfCWaz8sC6eJvVIZ7PjwXOqkSbMDa69MWwM6pIBIvP6IOUykjq659Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC97DKdb7BX9Z7hMtONjr4TtcTtpIUPiw+1stAfqVD3twIhAMXuyz/uU8kZ4638tqQ3cnAA1SYSHnxfaAzO2P4G2Vgq"}]},"maintainers":[{"name":"tomn","email":"tom@tomn.co.uk"}]},"0.1.0":{"name":"shet-client","description":"SHET client","version":"0.1.0","homepage":"https://github.com/18sg/shet-client.js/","repository":{"type":"git","url":"git://github.com/18sg/shet-client.js.git"},"author":{"name":"Thomas Nixon","email":"tom@tomn.co.uk","url":"http://tomn.co.uk"},"main":"lib/node.js","browserify":"lib/browser.js","directories":{"lib":"lib"},"engines":{"node":"*"},"dependencies":{"q":"*","recon":"*","lines-adapter":"*"},"_npmUser":{"name":"tomn","email":"tom@tomn.co.uk"},"_id":"shet-client@0.1.0","devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"98de90f90c4a00a98a225e2f62aa439d368e2dae","tarball":"https://registry.npmjs.org/shet-client/-/shet-client-0.1.0.tgz","integrity":"sha512-33/ht1bH+vLHPJGkLxvJaCar+dpMNOsCNd9L0bOR01kKGzXHlf9Pt2iKewAAaT+jjE6L5suWehy0i7EnmJOA+A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDTBUWYWlWoeE/2Hir5ohV+AK08qs9B2vjAty7556WsQAiA2VW+/wKTJqWO19PbfxUhB0toknrzByjWqySbrgBZxEA=="}]},"readme":"A client library for [SHET](https://github.com/18sg/SHET). It can be used in\n[Node.js](http://nodejs.org/), or in web browsers using\n[Socket.IO](http://socket.io/).\n\n## Get\n\n\tnpm install shet-client\n\n## Use\n### In Node.js\n\n\tvar shet = new (require(\"shet-client\").Client)();\n\n### In the browser\n\nThis uses Socket.IO, so it's probably easiest to get that working first (see\n[http://socket.io/#how-to-use](http://socket.io/#how-to-use)).\n\nInstall as above, then use\n[Browserify](https://github.com/substack/node-browserify) to generate a single\nlibrary file:\n\n\tbrowserify -r shet-client -o public/shet.js\n\nInclude this in your page, then add the something like this to the server:\n\n\t# after \"io = require('socket.io').listen(app)\"\n\trequire(\"shet-client\").listen_socket(io);\n\n...and something like this to the client:\n\n\t# after \"var socket = io.connect(...);\"\n\tvar shet = new (require(\"shet-client\").Client)(socket);\n\nThis creates a SHET client, that can be used exactly as in Node.\n\n### The API\n\nRather than using callbacks for everything, this library uses\n[Q](https://github.com/kriskowal/q) to provide 'deferred values' or 'promises',\nas in the Twisted version.\n\n#### var c = new Client()\n\nCreate a new client. The host and port to connect to are taken from $SHET_HOST\nand $SHET_PORT, and default to localhost:11235, as is standard.\n\n#### var c = new Client(socket)\n\nCreate a new client connected to the given Socket.IO channel.\n\n#### listen_socket(socket)\n\nAccept connections on the given Socket.IO channel, and pass traffic to the SHET\nserver (which is resolved as above).\n\n#### c.add_action(path, callback)\n\nAdd an action. When the action is called, `callback` will be called with the\nappropriate arguments, and it's return value will be returned to the caller. If\n`callback` returns a Q promise, it will wait for this to resolve before\nreturning, as expected.\n\n#### c.add_event(path)\n\nAdd an event. This returns an object with a `raise` attribute. Calling this\nwith any number of arguments raises the event with the given arguments.\n\n#### c.add_prop(path, get_cb, set_cb)\n\nAdd a property. `get_cb` should take no arguments and return the desired value\nof the property. `set_cb` should take a single argument, and set the property.\n\n#### c.watch(path, callback)\n\nWatch an event. The callback will be called with the arguments of the event.\n\n#### c.call(path, args...)\n\nCall an action with some arguments. This returns a promise, which will resolve\nto the return value of the action.\n\n#### c.get(path)\n\nGet a property. This returns a promise, which will resolve to the return value\nof the action.\n\n#### c.set(path, value)\n\nSet a property to `value`. This returns a promise, which will resolve when the\nset completes.\n\n## Todo\n\n- Examples\n- Setting the root directory\n- Removing properties/events/actions.\n- Event added/removed events?\n- Testing\n\n## About\n\nMIT licensed; see [LICENSE](https://github.com/18sg/shet-client.js/blob/master/LICENSE).\n\nBuilt with [CoffeeScript](http://coffeescript.org/),\n[Node.js](http://nodejs.org/), [Socket.IO](http://socket.io/),\n[Q](https://github.com/kriskowal/q),\n[Browserify](https://github.com/substack/node-browserify),\n[recon](https://github.com/substack/node-recon), and\n[lines-adapter](https://github.com/jonseymour/node-lines-adapter).\n","maintainers":[{"name":"tomn","email":"tom@tomn.co.uk"}]},"0.2.0":{"name":"shet-client","description":"SHET client","version":"0.2.0","homepage":"https://github.com/18sg/shet-client.js/","repository":{"type":"git","url":"git://github.com/18sg/shet-client.js.git"},"author":{"name":"Thomas Nixon","email":"tom@tomn.co.uk","url":"http://tomn.co.uk"},"main":"lib/node.js","browserify":"lib/browser.js","directories":{"lib":"lib"},"engines":{"node":"*"},"dependencies":{"q":"*","recon":"*","lines-adapter":"*"},"_npmUser":{"name":"tomn","email":"tom@tomn.co.uk"},"_id":"shet-client@0.2.0","devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.1","_nodeVersion":"v0.6.11","_defaultsLoaded":true,"dist":{"shasum":"52c00b469176466903ebf39d81ce4c2cc24de834","tarball":"https://registry.npmjs.org/shet-client/-/shet-client-0.2.0.tgz","integrity":"sha512-RcIOv6+YhCI/N+JxadY3ephLYVCuncFpg26tT6v3DnXBto/jROENzBnpWX20E2SoclOQphzL+QCo/CiMAxWwbw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEsGSG71yM3dhyBgHzBgCL3VDF259JsBsoAPKFb/F9x2AiEAgAAbmiPgvdE8SLLnxjlcq2zMYF69cX4eJX5ZeulTL4c="}]},"readme":"A client library for [SHET](https://github.com/18sg/SHET). It can be used in\n[Node.js](http://nodejs.org/), or in web browsers using\n[Socket.IO](http://socket.io/).\n\n## Get\n\n\tnpm install shet-client\n\n## Use\n### In Node.js\n\n\tvar shet = require(\"shet-client\").connect();\n\n### In the browser\n\nThis uses Socket.IO, so it's probably easiest to get that working first (see\n[http://socket.io/#how-to-use](http://socket.io/#how-to-use)).\n\nInstall as above, then use\n[Browserify](https://github.com/substack/node-browserify) to generate a single\nlibrary file:\n\n\tbrowserify -r shet-client -o public/shet.js\n\nInclude this in your page, then add the something like this to the server:\n\n\t# after \"io = require('socket.io').listen(app)\"\n\trequire(\"shet-client\").listen_socket(io);\n\n...and something like this to the client:\n\n\t# after \"var socket = io.connect(...);\"\n\tvar shet = require(\"shet-client\").connect(socket);\n\nThis creates a SHET client, that can be used exactly as in Node.\n\n### The API\n\nRather than using callbacks for everything, this library uses\n[Q](https://github.com/kriskowal/q) to provide 'deferred values' or 'promises',\nas in the Twisted version.\n\n#### var c = connect()\n\nCreate a new client. The host and port to connect to are taken from $SHET_HOST\nand $SHET_PORT, and default to localhost:11235, as is standard.\n\n#### var c = connect(socket)\n\nCreate a new client connected to the given Socket.IO channel.\n\n#### listen_socket(socket)\n\nAccept connections on the given Socket.IO channel, and pass traffic to the SHET\nserver (which is resolved as above).\n\n#### c.add_action(path, callback)\n\nAdd an action. When the action is called, `callback` will be called with the\nappropriate arguments, and it's return value will be returned to the caller. If\n`callback` returns a Q promise, it will wait for this to resolve before\nreturning, as expected.\n\n#### c.add_event(path)\n\nAdd an event. This returns an object with a `raise` attribute. Calling this\nwith any number of arguments raises the event with the given arguments.\n\n#### c.add_prop(path, get_cb, set_cb)\n\nAdd a property. `get_cb` should take no arguments and return the desired value\nof the property. `set_cb` should take a single argument, and set the property.\n\n#### c.watch(path, callback)\n\nWatch an event. The callback will be called with the arguments of the event.\n\n#### c.call(path, args...)\n\nCall an action with some arguments. This returns a promise, which will resolve\nto the return value of the action.\n\n#### c.get(path)\n\nGet a property. This returns a promise, which will resolve to the return value\nof the action.\n\n#### c.set(path, value)\n\nSet a property to `value`. This returns a promise, which will resolve when the\nset completes.\n\n## Todo\n\n- Examples\n- Setting the root directory\n- Removing properties/events/actions.\n- Event added/removed events?\n- Testing\n\n## About\n\nMIT licensed; see [LICENSE](https://github.com/18sg/shet-client.js/blob/master/LICENSE).\n\nBuilt with [CoffeeScript](http://coffeescript.org/),\n[Node.js](http://nodejs.org/), [Socket.IO](http://socket.io/),\n[Q](https://github.com/kriskowal/q),\n[Browserify](https://github.com/substack/node-browserify),\n[recon](https://github.com/substack/node-recon), and\n[lines-adapter](https://github.com/jonseymour/node-lines-adapter).\n","maintainers":[{"name":"tomn","email":"tom@tomn.co.uk"}]},"0.2.1":{"name":"shet-client","description":"SHET client","version":"0.2.1","homepage":"https://github.com/18sg/shet-client.js/","repository":{"type":"git","url":"git://github.com/18sg/shet-client.js.git"},"author":{"name":"Thomas Nixon","email":"tom@tomn.co.uk","url":"http://tomn.co.uk"},"main":"lib/node.js","browserify":"lib/browser.js","directories":{"lib":"lib"},"engines":{"node":"*"},"dependencies":{"q":"*","recon":"*","lazy":"*"},"_npmUser":{"name":"tomn","email":"tom@tomn.co.uk"},"_id":"shet-client@0.2.1","devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.12","_nodeVersion":"v0.6.14","_defaultsLoaded":true,"dist":{"shasum":"99cd07a5496683c56478688f2f931e8222075561","tarball":"https://registry.npmjs.org/shet-client/-/shet-client-0.2.1.tgz","integrity":"sha512-Y12kkYqT6e6fFosC7TS7ZBVxgavPWpxfRdjvBI9yEt99T+lgUBOgWyEM/stLISIa1utOoWRWagLrsv5sW1vU6w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGlyugVbjYSET4mlkA9ke7wA9F0fMsBncGNnsrAeksOEAiAp1LrHFJwejC4eB1Dp8R9WhjLWo3ZF3byN3cl9zvF5wA=="}]},"readme":"A client library for [SHET](https://github.com/18sg/SHET). It can be used in\n[Node.js](http://nodejs.org/), or in web browsers using\n[Socket.IO](http://socket.io/).\n\n## Get\n\n\tnpm install shet-client\n\n## Use\n### In Node.js\n\n\tvar shet = require(\"shet-client\").connect();\n\n### In the browser\n\nThis uses Socket.IO, so it's probably easiest to get that working first (see\n[http://socket.io/#how-to-use](http://socket.io/#how-to-use)).\n\nInstall as above, then use\n[Browserify](https://github.com/substack/node-browserify) to generate a single\nlibrary file:\n\n\tbrowserify -r shet-client -o public/shet.js\n\nInclude this in your page, then add the something like this to the server:\n\n\t# after \"io = require('socket.io').listen(app)\"\n\trequire(\"shet-client\").listen_socket(io);\n\n...and something like this to the client:\n\n\t# after \"var socket = io.connect(...);\"\n\tvar shet = require(\"shet-client\").connect(socket);\n\nThis creates a SHET client, that can be used exactly as in Node.\n\n### The API\n\nRather than using callbacks for everything, this library uses\n[Q](https://github.com/kriskowal/q) to provide 'deferred values' or 'promises',\nas in the Twisted version.\n\n#### var c = connect()\n\nCreate a new client. The host and port to connect to are taken from $SHET_HOST\nand $SHET_PORT, and default to localhost:11235, as is standard.\n\n#### var c = connect(socket)\n\nCreate a new client connected to the given Socket.IO channel.\n\n#### listen_socket(socket)\n\nAccept connections on the given Socket.IO channel, and pass traffic to the SHET\nserver (which is resolved as above).\n\n#### c.add_action(path, callback)\n\nAdd an action. When the action is called, `callback` will be called with the\nappropriate arguments, and it's return value will be returned to the caller. If\n`callback` returns a Q promise, it will wait for this to resolve before\nreturning, as expected.\n\n#### c.add_event(path)\n\nAdd an event. This returns an object with a `raise` attribute. Calling this\nwith any number of arguments raises the event with the given arguments.\n\n#### c.add_prop(path, get_cb, set_cb)\n\nAdd a property. `get_cb` should take no arguments and return the desired value\nof the property. `set_cb` should take a single argument, and set the property.\n\n#### c.watch(path, callback)\n\nWatch an event. The callback will be called with the arguments of the event.\n\n#### c.call(path, args...)\n\nCall an action with some arguments. This returns a promise, which will resolve\nto the return value of the action.\n\n#### c.get(path)\n\nGet a property. This returns a promise, which will resolve to the return value\nof the action.\n\n#### c.set(path, value)\n\nSet a property to `value`. This returns a promise, which will resolve when the\nset completes.\n\n## Todo\n\n- Examples\n- Setting the root directory\n- Removing properties/events/actions.\n- Event added/removed events?\n- Testing\n\n## About\n\nMIT licensed; see [LICENSE](https://github.com/18sg/shet-client.js/blob/master/LICENSE).\n\nBuilt with [CoffeeScript](http://coffeescript.org/),\n[Node.js](http://nodejs.org/), [Socket.IO](http://socket.io/),\n[Q](https://github.com/kriskowal/q),\n[Browserify](https://github.com/substack/node-browserify),\n[recon](https://github.com/substack/node-recon), and\n[Lazy](https://github.com/pkrumins/node-lazy).\n","maintainers":[{"name":"tomn","email":"tom@tomn.co.uk"}]},"0.3.0":{"name":"shet-client","description":"SHET client","version":"0.3.0","homepage":"https://github.com/18sg/shet-client.js/","repository":{"type":"git","url":"git://github.com/18sg/shet-client.js.git"},"author":{"name":"Thomas Nixon","email":"tom@tomn.co.uk","url":"http://tomn.co.uk"},"main":"lib/node.js","browserify":"lib/browser.js","directories":{"lib":"lib"},"engines":{"node":"*"},"dependencies":{"q":"*","recon":"*","lazy":"*"},"_npmUser":{"name":"tomn","email":"tom@tomn.co.uk"},"_id":"shet-client@0.3.0","devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.6.18","_defaultsLoaded":true,"dist":{"shasum":"cdec35af49d5460056425e442b978254eb812f82","tarball":"https://registry.npmjs.org/shet-client/-/shet-client-0.3.0.tgz","integrity":"sha512-+erA3+ui+aqGxtgH9hS/rWvNeI+fjn//6AhwViDHWnKQ1Dug5bGmAwL7SVKnQVdXrxo0CpjxMSAJZkbTx7eLzQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9vDJquALKYfPCClu3NLkWKpb+yNnml0QpF0QUHvVOmgIhALnsDe8cJG97q9bnMUtDNqMZoRNt7kp6VK4hfD0SkIPo"}]},"readme":"A client library for [SHET](https://github.com/18sg/SHET). It can be used in\n[Node.js](http://nodejs.org/), or in web browsers using\n[Socket.IO](http://socket.io/).\n\n## Get\n\n\tnpm install shet-client\n\n## Use\n### In Node.js\n\n\tvar shet = require(\"shet-client\").connect();\n\n### In the browser\n\nThis uses Socket.IO, so it's probably easiest to get that working first (see\n[http://socket.io/#how-to-use](http://socket.io/#how-to-use)).\n\nInstall as above, then use\n[Browserify](https://github.com/substack/node-browserify) to generate a single\nlibrary file:\n\n\tbrowserify -r shet-client -o public/shet.js\n\nInclude this in your page, then add the something like this to the server:\n\n\t# after \"io = require('socket.io').listen(app)\"\n\trequire(\"shet-client\").listen_socket(io);\n\n...and something like this to the client:\n\n\t# after \"var socket = io.connect(...);\"\n\tvar shet = require(\"shet-client\").connect(socket);\n\nThis creates a SHET client, that can be used exactly as in Node.\n\n### The API\n\nRather than using callbacks for everything, this library uses\n[Q](https://github.com/kriskowal/q) to provide 'deferred values' or 'promises',\nas in the Twisted version.\n\n#### var c = connect([options])\n\nCreate a new client.\n\n`options` is an optional object that may contain the following keys:\n\n- `host`: The host to connect to. Defaults to $SHET_HOST or localhost.\n- `port`: The port to connect to. Defaults to $SHET_PORT or 11235.\n- `ping_interval`: The interval in milliseconds for sending pings to the server.\n  Defaults to 30,000. If 0, no pings are sent.\n\n#### var c = connect(socket)\n\nCreate a new client connected to the given Socket.IO channel.\n\n#### listen_socket(socket, [options])\n\nAccept connections on the given Socket.IO channel, and pass traffic to the SHET\nserver (which is resolved as above).\n\n#### c.add_action(path, callback)\n\nAdd an action. When the action is called, `callback` will be called with the\nappropriate arguments, and it's return value will be returned to the caller. If\n`callback` returns a Q promise, it will wait for this to resolve before\nreturning, as expected.\n\n#### c.add_event(path)\n\nAdd an event. This returns an object with a `raise` attribute. Calling this\nwith any number of arguments raises the event with the given arguments.\n\n#### c.add_prop(path, get_cb, set_cb)\n\nAdd a property. `get_cb` should take no arguments and return the desired value\nof the property. `set_cb` should take a single argument, and set the property.\n\n#### c.watch(path, callback)\n\nWatch an event. The callback will be called with the arguments of the event.\n\n#### c.call(path, args...)\n\nCall an action with some arguments. This returns a promise, which will resolve\nto the return value of the action.\n\n#### c.get(path)\n\nGet a property. This returns a promise, which will resolve to the return value\nof the action.\n\n#### c.set(path, value)\n\nSet a property to `value`. This returns a promise, which will resolve when the\nset completes.\n\n## Todo\n\n- Examples\n- Setting the root directory\n- Removing properties/events/actions.\n- Event added/removed events?\n- Testing\n\n## About\n\nMIT licensed; see [LICENSE](https://github.com/18sg/shet-client.js/blob/master/LICENSE).\n\nBuilt with [CoffeeScript](http://coffeescript.org/),\n[Node.js](http://nodejs.org/), [Socket.IO](http://socket.io/),\n[Q](https://github.com/kriskowal/q),\n[Browserify](https://github.com/substack/node-browserify),\n[recon](https://github.com/substack/node-recon), and\n[Lazy](https://github.com/pkrumins/node-lazy).\n","maintainers":[{"name":"tomn","email":"tom@tomn.co.uk"}]},"0.3.1":{"name":"shet-client","description":"SHET client","version":"0.3.1","homepage":"https://github.com/18sg/shet-client.js/","repository":{"type":"git","url":"git://github.com/18sg/shet-client.js.git"},"author":{"name":"Thomas Nixon","email":"tom@tomn.co.uk","url":"http://tomn.co.uk"},"main":"lib/node.js","browserify":"lib/browser.js","directories":{"lib":"lib"},"engines":{"node":"*"},"dependencies":{"q":"*","recon":"*","lazy":"*"},"_npmUser":{"name":"tomn","email":"tom@tomn.co.uk"},"_id":"shet-client@0.3.1","devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.6.18","_defaultsLoaded":true,"dist":{"shasum":"15b34eefc51a15fdec4695b4cc5714fc95cd5a71","tarball":"https://registry.npmjs.org/shet-client/-/shet-client-0.3.1.tgz","integrity":"sha512-sukkMVD+JMJgH8oliNHXm6PBi/VWXr/gfyfFg+rSFwfTJK6VHUDuKRHz2bxeESIIWsINsm9/LPDUfKeJ5IDToQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIARhN0/i8tGF357HsMnV5Mz/N4++0geTdye3O2jARZkuAiEA5cNDRYOPADR4Q0/XsBoJh8uGmU24rlG/2jEbOKk6tjo="}]},"readme":"A client library for [SHET](https://github.com/18sg/SHET). It can be used in\n[Node.js](http://nodejs.org/), or in web browsers using\n[Socket.IO](http://socket.io/).\n\n## Get\n\n\tnpm install shet-client\n\n## Use\n### In Node.js\n\n\tvar shet = require(\"shet-client\").connect();\n\n### In the browser\n\nThis uses Socket.IO, so it's probably easiest to get that working first (see\n[http://socket.io/#how-to-use](http://socket.io/#how-to-use)).\n\nInstall as above, then use\n[Browserify](https://github.com/substack/node-browserify) to generate a single\nlibrary file:\n\n\tbrowserify -r shet-client -o public/shet.js\n\nInclude this in your page, then add the something like this to the server:\n\n\t# after \"io = require('socket.io').listen(app)\"\n\trequire(\"shet-client\").listen_socket(io);\n\n...and something like this to the client:\n\n\t# after \"var socket = io.connect(...);\"\n\tvar shet = require(\"shet-client\").connect(socket);\n\nThis creates a SHET client, that can be used exactly as in Node.\n\n### The API\n\nRather than using callbacks for everything, this library uses\n[Q](https://github.com/kriskowal/q) to provide 'deferred values' or 'promises',\nas in the Twisted version.\n\n#### var c = connect([options])\n\nCreate a new client.\n\n`options` is an optional object that may contain the following keys:\n\n- `host`: The host to connect to. Defaults to $SHET_HOST or localhost.\n- `port`: The port to connect to. Defaults to $SHET_PORT or 11235.\n- `ping_interval`: The interval in milliseconds for sending pings to the server.\n  Defaults to 30,000. If 0, no pings are sent.\n\n#### var c = connect(socket)\n\nCreate a new client connected to the given Socket.IO channel.\n\n#### listen_socket(socket, [options])\n\nAccept connections on the given Socket.IO channel, and pass traffic to the SHET\nserver (which is resolved as above).\n\n#### c.add_action(path, callback)\n\nAdd an action. When the action is called, `callback` will be called with the\nappropriate arguments, and it's return value will be returned to the caller. If\n`callback` returns a Q promise, it will wait for this to resolve before\nreturning, as expected.\n\n#### c.add_event(path)\n\nAdd an event. This returns an object with a `raise` attribute. Calling this\nwith any number of arguments raises the event with the given arguments.\n\n#### c.add_prop(path, get_cb, set_cb)\n\nAdd a property. `get_cb` should take no arguments and return the desired value\nof the property. `set_cb` should take a single argument, and set the property.\n\n#### c.watch(path, callback)\n\nWatch an event. The callback will be called with the arguments of the event.\n\n#### c.call(path, args...)\n\nCall an action with some arguments. This returns a promise, which will resolve\nto the return value of the action.\n\n#### c.get(path)\n\nGet a property. This returns a promise, which will resolve to the return value\nof the action.\n\n#### c.set(path, value)\n\nSet a property to `value`. This returns a promise, which will resolve when the\nset completes.\n\n## Todo\n\n- Examples\n- Setting the root directory\n- Removing properties/events/actions.\n- Event added/removed events?\n- Testing\n\n## About\n\nMIT licensed; see [LICENSE](https://github.com/18sg/shet-client.js/blob/master/LICENSE).\n\nBuilt with [CoffeeScript](http://coffeescript.org/),\n[Node.js](http://nodejs.org/), [Socket.IO](http://socket.io/),\n[Q](https://github.com/kriskowal/q),\n[Browserify](https://github.com/substack/node-browserify),\n[recon](https://github.com/substack/node-recon), and\n[Lazy](https://github.com/pkrumins/node-lazy).\n","maintainers":[{"name":"tomn","email":"tom@tomn.co.uk"}]}},"maintainers":[{"name":"tomn","email":"tom@tomn.co.uk"}],"time":{"modified":"2022-06-26T18:50:09.182Z","created":"2011-11-10T00:56:42.360Z","0.0.0":"2011-11-10T01:00:59.127Z","0.0.1":"2011-11-10T01:07:04.006Z","0.0.2":"2011-11-10T01:11:43.159Z","0.1.0":"2012-02-15T01:55:18.566Z","0.2.0":"2012-02-27T20:20:44.374Z","0.2.1":"2012-04-10T21:19:39.351Z","0.3.0":"2012-05-29T16:52:01.534Z","0.3.1":"2012-06-03T17:11:37.336Z"},"author":{"name":"Thomas Nixon","email":"tom@tomn.co.uk","url":"http://tomn.co.uk"},"repository":{"type":"git","url":"git://github.com/18sg/shet-client.js.git"}}