{"_id":"share","_rev":"31-7fb4bb5c96b90e1dfa5d6f3d268c671d","name":"share","description":"A database for concurrent document editing","dist-tags":{"latest":"0.6.2"},"versions":{"0.1.0":{"name":"share","version":"0.1.0","description":"A database for concurrent document editing","keywords":["operational transformation","ot","concurrent","collaborative","database","server"],"homepage":"","author":{"name":"Joseph Gentle","email":"josephg@gmail.com"},"main":"lib/index.js","bin":{"sharejs":"bin/sharejs","sharejs-exampleserver":"bin/exampleserver"},"dependencies":{"socket.io":">= 0.6.0","connect":">= 1.1.1 < 2.0.0","coffee-script":"~1.0.0","redis":"*","nodeunit":"~0.5.0"},"licenses":[{"type":"BSD","url":"http://www.freebsd.org/copyright/freebsd-license.html"}],"repository":{"type":"git","url":"git://github.com/josephg/sharejs.git"},"_id":"share@0.1.0","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.3.18","_nodeVersion":"v0.4.5","directories":{"lib":"./lib","bin":"./bin","doc":"./doc"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"23a0346a4021b42c63d3f8e5557ca160306f828a","tarball":"http://registry.npmjs.org/share/-/share-0.1.0.tgz"}},"0.1.1":{"name":"share","version":"0.1.1","description":"A database for concurrent document editing","keywords":["operational transformation","ot","concurrent","collaborative","database","server"],"homepage":"","author":{"name":"Joseph Gentle","email":"josephg@gmail.com"},"main":"lib/index.js","bin":{"sharejs":"bin/sharejs","sharejs-exampleserver":"bin/exampleserver"},"dependencies":{"socket.io":">= 0.6.0","connect":">= 1.1.1 < 2.0.0","coffee-script":"~1.0.0","redis":"*","nodeunit":"~0.5.0"},"licenses":[{"type":"BSD","url":"http://www.freebsd.org/copyright/freebsd-license.html"}],"repository":{"type":"git","url":"git://github.com/josephg/sharejs.git"},"_id":"share@0.1.1","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.3.18","_nodeVersion":"v0.4.5","directories":{"lib":"./lib","bin":"./bin","doc":"./doc"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"572516600788093202961826c439eda22462d771","tarball":"http://registry.npmjs.org/share/-/share-0.1.1.tgz"}},"0.2.1":{"name":"share","version":"0.2.1","description":"A database for concurrent document editing","keywords":["operational transformation","ot","concurrent","collaborative","database","server"],"homepage":"","author":{"name":"Joseph Gentle","email":"josephg@gmail.com"},"main":"lib/index.js","bin":{"sharejs":"bin/sharejs","sharejs-exampleserver":"bin/exampleserver"},"dependencies":{"socket.io":"~0.6.0","connect":">= 1.1.1 < 2.0.0","coffee-script":"> 1.1.0","redis":"*","nodeunit":"~0.5.0","optimist":">= 0.2.4","websocket-client":">= 1.0.0"},"licenses":[{"type":"BSD","url":"http://www.freebsd.org/copyright/freebsd-license.html"}],"repository":{"type":"git","url":"git://github.com/josephg/sharejs.git"},"_id":"share@0.2.1","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.3.18","_nodeVersion":"v0.4.8","directories":{"lib":"./lib","bin":"./bin","doc":"./doc"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"2b01657d9011b72b1041f50b507cb9957d1475a8","tarball":"http://registry.npmjs.org/share/-/share-0.2.1.tgz"}},"0.2.2":{"name":"share","version":"0.2.2","description":"A database for concurrent document editing","keywords":["operational transformation","ot","concurrent","collaborative","database","server"],"homepage":"","author":{"name":"Joseph Gentle","email":"josephg@gmail.com"},"main":"lib/index.js","bin":{"sharejs":"bin/sharejs","sharejs-exampleserver":"bin/exampleserver"},"dependencies":{"socket.io":"~0.6.0","connect":">= 1.1.1 < 2.0.0","coffee-script":"> 1.1.0","redis":"*","nodeunit":"~0.5.0","optimist":">= 0.2.4","websocket-client":">= 1.0.0"},"licenses":[{"type":"BSD","url":"http://www.freebsd.org/copyright/freebsd-license.html"}],"repository":{"type":"git","url":"git://github.com/josephg/sharejs.git"},"_npmJsonOpts":{"file":"/Users/josephg/.npm/share/0.2.2/package/package.json","wscript":false,"serverjs":false,"contributors":["Joseph Gentle <josephg@gmail.com>"]},"_id":"share@0.2.2","contributors":[{"name":"Joseph Gentle","email":"josephg@gmail.com"}],"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.9","_defaultsLoaded":true,"dist":{"shasum":"f655a11b263cc2a0ca5b6ad2a56672750ad1d22c","tarball":"http://registry.npmjs.org/share/-/share-0.2.2.tgz"},"scripts":{},"directories":{}},"0.3.0":{"name":"share","version":"0.3.0","description":"A database for concurrent document editing","keywords":["operational transformation","ot","concurrent","collaborative","database","server"],"homepage":"","author":{"name":"Joseph Gentle","email":"josephg@gmail.com"},"main":"lib/index.js","bin":{"sharejs":"bin/sharejs","sharejs-exampleserver":"bin/exampleserver"},"dependencies":{"socket.io":"~0.6.0","connect":">= 1.1.1 < 2.0.0","coffee-script":"> 1.1.0","redis":"*","nodeunit":"~0.5.0","optimist":">= 0.2.4","websocket-client":">= 1.0.0"},"licenses":[{"type":"BSD","url":"http://www.freebsd.org/copyright/freebsd-license.html"}],"repository":{"type":"git","url":"git://github.com/josephg/sharejs.git"},"_npmJsonOpts":{"file":"/Users/josephg/.npm/share/0.3.0/package/package.json","wscript":false,"serverjs":false,"contributors":["Joseph Gentle <josephg@gmail.com>"]},"_id":"share@0.3.0","contributors":[{"name":"Joseph Gentle","email":"josephg@gmail.com"}],"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"c21fdb70c98fe6cc1b57dabf9a637bdde8566876","tarball":"http://registry.npmjs.org/share/-/share-0.3.0.tgz"},"scripts":{},"maintainers":[{"name":"josephg","email":"josephg@gmail.com"}],"directories":{}},"0.4.0":{"name":"share","version":"0.4.0","description":"A database for concurrent document editing","keywords":["operational transformation","ot","concurrent","collaborative","database","server"],"homepage":"","author":{"name":"Joseph Gentle","email":"josephg@gmail.com"},"main":"lib/index.js","bin":{"sharejs":"bin/sharejs","sharejs-exampleserver":"bin/exampleserver"},"dependencies":{"socket.io":"~0.8","socket.io-client":"~0.8","connect":">= 1.1.1 < 2.0.0","optimist":">= 0.2.4"},"devDependencies":{"nodeunit":"~0.5.0","coffee-script":"> 1.1.0"},"engine":"node >= 0.4.4","scripts":{"build":"cake build","test":"nodeunit tests.coffee"},"licenses":[{"type":"BSD","url":"http://www.freebsd.org/copyright/freebsd-license.html"}],"repository":{"type":"git","url":"git://github.com/josephg/sharejs.git"},"_npmJsonOpts":{"file":"/Users/josephg/.npm/share/0.4.0/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"share@0.4.0","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"e6aa381b7826759ffbea3c7cc776e6101f5dd895","tarball":"http://registry.npmjs.org/share/-/share-0.4.0.tgz"},"maintainers":[{"name":"josephg","email":"josephg@gmail.com"}],"directories":{}},"0.4.1":{"name":"share","version":"0.4.1","description":"A database for concurrent document editing","keywords":["operational transformation","ot","concurrent","collaborative","database","server"],"homepage":"","author":{"name":"Joseph Gentle","email":"josephg@gmail.com"},"main":"lib/index.js","bin":{"sharejs":"bin/sharejs","sharejs-exampleserver":"bin/exampleserver"},"dependencies":{"socket.io":"~0.8","socket.io-client":"~0.8","connect":">= 1.1.1 < 2.0.0","optimist":">= 0.2.4","uglify-js":"~1","hat":"*"},"devDependencies":{"nodeunit":"~0.5.0","coffee-script":"> 1.1.0"},"engine":"node >= 0.4.4","scripts":{"build":"cake build","test":"nodeunit tests.coffee"},"licenses":[{"type":"BSD","url":"http://www.freebsd.org/copyright/freebsd-license.html"}],"repository":{"type":"git","url":"git://github.com/josephg/sharejs.git"},"_npmJsonOpts":{"file":"/Users/josephg/.npm/share/0.4.1/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"share@0.4.1","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"d72a3f6773c89bd59d5b904df6b437b8efa47438","tarball":"http://registry.npmjs.org/share/-/share-0.4.1.tgz"},"maintainers":[{"name":"josephg","email":"josephg@gmail.com"}],"directories":{}},"0.5.0-pre":{"name":"share","version":"0.5.0-pre","description":"A database for concurrent document editing","keywords":["operational transformation","ot","concurrent","collaborative","database","server"],"homepage":"","author":{"name":"Joseph Gentle","email":"josephg@gmail.com"},"main":"index.js","bin":{"sharejs":"bin/sharejs","sharejs-exampleserver":"bin/exampleserver"},"dependencies":{"socket.io":"~0.8","socket.io-client":"~0.8","connect":">= 1.1.1 < 2.0.0","optimist":">= 0.2.4","uglify-js":"~1","request":">= 2.1.1","coffee-script":"> 1.1.0","browserchannel":"*","hat":"*"},"devDependencies":{"nodeunit":"~0.5.0"},"engine":"node >= 0.4.4","scripts":{"build":"cake build","test":"nodeunit tests.coffee"},"licenses":[{"type":"BSD","url":"http://www.freebsd.org/copyright/freebsd-license.html"}],"repository":{"type":"git","url":"git://github.com/josephg/sharejs.git"},"_npmUser":{"name":"josephg","email":"josephg@gmail.com"},"_id":"share@0.5.0-pre","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.98","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"34311487e65caa8899ec849693e7034cdb7473a7","tarball":"http://registry.npmjs.org/share/-/share-0.5.0-pre.tgz"},"maintainers":[{"name":"josephg","email":"josephg@gmail.com"}],"directories":{}},"0.5.0":{"name":"share","version":"0.5.0","description":"A database for concurrent document editing","keywords":["operational transformation","ot","concurrent","collaborative","database","server"],"homepage":"","author":{"name":"Joseph Gentle","email":"josephg@gmail.com"},"main":"index.js","bin":{"sharejs":"bin/sharejs","sharejs-exampleserver":"bin/exampleserver"},"dependencies":{"socket.io":"~0.8","socket.io-client":"~0.8","connect":"~1","optimist":">= 0.2.4","uglify-js":"~1","request":">= 2.1.1","coffee-script":"*","browserchannel":"*","hat":"*"},"devDependencies":{"nodeunit":"*"},"engine":"node >= 0.4.4","scripts":{"build":"cake build","test":"nodeunit tests.coffee"},"licenses":[{"type":"BSD","url":"http://www.freebsd.org/copyright/freebsd-license.html"}],"repository":{"type":"git","url":"http://github.com/josephg/sharejs.git"},"readme":"ShareJS\n=======\n\nThis is a little server (& client library) to allow concurrent editing of any kind of content. The server runs on NodeJS and the client works in NodeJS or a web browser.\n\nShareJS currently supports operational transform on plain-text and arbitrary JSON data.\n\n**Immerse yourself in [API Documentation](https://github.com/josephg/ShareJS/wiki).**\n\n**Visit [Google groups](https://groups.google.com/forum/?fromgroups#!forum/sharejs) for discussions and announcements**\n\n**Check out the [live interactive demos](http://sharejs.org/).**\n\n> Note: CI sometimes breaks for random reasons even though the tests work locally. Don't stress!\n[![Build Status](https://secure.travis-ci.org/josephg/ShareJS.png)](http://travis-ci.org/josephg/ShareJS)\n\n\nBrowser support\n---------------\n\nShareJS **should** work with all of them ![logos of all of all the browsers](http://twitter.github.com/bootstrap/assets/img/browsers.png)\n\nThat said, I only test regularly with FF, Safari and Chrome, and occasionally with IE8+. **File bug reports if you have issues**\n\n\nInstalling and running\n----------------------\n\n    # npm install share\n\nRun the examples with:\n\n    # sharejs-exampleserver\n\nIf you want redis support, you'll need to install redis:\n\n    # sudo brew install redis\n    # npm install -g redis\n\n### From source\n\nInstall redis (optional)\n    \n* Mac:\n\n        # sudo brew install redis\n\n* Linux:\n   \n        # sudo apt-get install redis\n\nThen:\n\n    # git clone git://github.com/josephg/ShareJS.git\n    # cd ShareJS\n    # npm install redis   # If you want redis support\n    # npm link\n\nRun the tests:\n\n    # cake test\n\nBuild the coffeescript into .js:\n\n    # cake build\n    # cake webclient\n\nRun the example server:\n\n    # bin/exampleserver\n\nRunning a server\n----------------\n\nThere are two ways to run a sharejs server:\n\n1. Embedded in a node.js server app:\n\n    ```javascript\n    var connect = require('connect'),\n        sharejs = require('share').server;\n\n    var server = connect(\n          connect.logger(),\n          connect.static(__dirname + '/my_html_files')\n        );\n\n    var options = {db: {type: 'none'}}; // See docs for options. {type: 'redis'} to enable persistance.\n\n    // Attach the sharejs REST and Socket.io interfaces to the server\n    sharejs.attach(server, options);\n\n    server.listen(8000);\n    console.log('Server running at http://127.0.0.1:8000/');\n    ```\n    The above script will start up a ShareJS server on port 8000 which hosts static content from the `my_html_files` directory. See [bin/exampleserver](https://github.com/josephg/ShareJS/blob/master/bin/exampleserver) for a more complex configuration example.\n\n    > See the [Connect](http://senchalabs.github.com/connect/) or [Express](http://expressjs.com/) documentation for more complex routing.\n\n2. From the command line:\n\n        # sharejs\n    Configuration is pulled from a configuration file that can't be easily edited at the moment. For now, I recommend method #1 above.\n\n3. If you are just mucking around, run:\n\n        # sharejs-exampleserver\n  \n    This will run a simple server on port 8000, and host all the example code there. Run it and check out http://localhost:8000/ . The example server stores everything in ram, so don't get too attached to your data.\n\n    > If you're running sharejs from source, you can launch the example server by running `bin/exampleserver`.\n\n\nPutting Share.js on your website\n--------------------------------\n\nIf you want to get a simple editor working in your webpage with sharejs, here's what you need to do:\n\nFirst, get an ace editor on your page:\n\n```html\n<div id=\"editor\"></div>\n```\n\nYour web app will need access to the following JS files:\n\n- Ace (http://ace.ajax.org/)\n- Browserchannel\n- ShareJS client and ace bindings.\n\nAdd these script tags:\n\n```html\n<script src=\"http://ajaxorg.github.com/ace/build/src/ace.js\"></script>\n<script src=\"/channel/bcsocket.js\"></script>\n<script src=\"/share/share.js\"></script>\n<script src=\"/share/ace.js\"></script>\n```\n\nAnd add this code:\n\n```html\n<script>\n    var editor = ace.edit(\"editor\");\n\n    sharejs.open('hello', 'text', function(error, doc) {\n        doc.attach_ace(editor);\n    });\n</script>\n```\n\n> **NOTE:** If you're using the current version in npm (0.4) or earler, the argument order is the other way around (`function(doc, error)`).\n\nThats about it :)\n\nThe easiest way to get your code running is to check sharejs out from source and put your html and css files in the `examples/` directory. Run `bin/exampleserver` to launch the demo server and browse to http://localhost:8000/your-app.html .\n\nSee the [wiki](https://github.com/josephg/ShareJS/wiki) for documentation.\n\nIts also possible to use sharejs without ace. See the textarea example for details.\n\nWriting a client using node.js\n------------------------------\n\nThe client API is the same whether you're using the web or nodejs.\n\nHere's an example application which opens a document and inserts some text in it. Every time an op is applied to the document, it'll print out the document's version.\n\nRun this from a couple terminal windows when sharejs is running to see it go.\n\n```javascript\nvar client = require('share').client;\n\n// Open the 'hello' document, which should have type 'text':\nclient.open('hello', 'text', 'http://localhost:8000/sjs', function(error, doc) {\n    // Insert some text at the start of the document (position 0):\n    doc.insert(\"Hi there!\\n\", 0);\n\n    // Get the contents of the document for some reason:\n    console.log(doc.snapshot);\n\n    doc.on('change', function(op) {\n        console.log('Version: ' + doc.version);\n    });\n\n    // Close the doc if you want your node app to exit cleanly\n    // doc.close();\n});\n```\n\n> **NOTE:** If you're using the current version in npm (0.4) or earler, the argument order is the other way around (`function(doc, error)`).\n\nSee [`the wiki`](https://github.com/josephg/ShareJS/wiki) for API documentation, and `examples/node*` for some more example apps.\n\n\n","_id":"share@0.5.0","dist":{"shasum":"87b9eb024da1a5be5efd8826c387750272ec3dee","tarball":"http://registry.npmjs.org/share/-/share-0.5.0.tgz"},"maintainers":[{"name":"josephg","email":"josephg@gmail.com"}],"directories":{}},"0.6.0":{"name":"share","version":"0.6.0","description":"A database for concurrent document editing","keywords":["operational transformation","ot","concurrent","collaborative","database","server"],"homepage":"","author":{"name":"Joseph Gentle","email":"josephg@gmail.com"},"dependencies":{"sockjs":">= 0.3.1","socket.io":"~0.8","socket.io-client":"~0.8","browserchannel":"*","ws":"*","connect":"<3.x","request":">= 2.1.1","coffee-script":"<1.6","hat":"*"},"devDependencies":{"express":"~ 3.x","optimist":">= 0.2.4","nodeunit":"*","shelljs":"*","uglify-js":"~1","websocket":"*"},"engine":"node >= 0.6","main":"index.js","bin":{"sharejs":"bin/sharejs","sharejs-exampleserver":"bin/exampleserver"},"scripts":{"build":"cake build","test":"cake test","prepublish":"cake webclient"},"licenses":[{"type":"BSD","url":"http://www.freebsd.org/copyright/freebsd-license.html"}],"repository":{"type":"git","url":"http://github.com/josephg/sharejs.git"},"readme":"ShareJS\n=======\n\nThis is a little server (& client library) to allow concurrent editing of any kind of content. The server runs on NodeJS and the client works in NodeJS or a web browser.\n\nShareJS currently supports operational transform on plain-text and arbitrary JSON data.\n\n**Immerse yourself in [API Documentation](https://github.com/josephg/ShareJS/wiki).**\n\n**Visit [Google groups](https://groups.google.com/forum/?fromgroups#!forum/sharejs) for discussions and announcements**\n\n**Check out the [live interactive demos](http://sharejs.org/).**\n\n> Note: CI sometimes breaks for random reasons even though the tests work locally. Don't stress!\n[![Build Status](https://secure.travis-ci.org/josephg/ShareJS.png)](http://travis-ci.org/josephg/ShareJS)\n\n\nBrowser support\n---------------\n\nShareJS **should** work with all of them ![logos of all of all the browsers](http://twitter.github.com/bootstrap/assets/img/browsers.png)\n\nThat said, I only test regularly with FF, Safari and Chrome, and occasionally with IE8+. **File bug reports if you have issues**\n\n\nInstalling and running\n----------------------\n\n    # npm install share\n\nRun the examples with:\n\n    # sharejs-exampleserver\n\nIf you want redis support, you'll need to install redis:\n\n    # brew install redis\n    # npm install -g redis\n\n### From source\n\nInstall redis (optional)\n    \n* Mac:\n\n        # brew install redis\n\n* Linux:\n   \n        # sudo apt-get install redis\n\nThen:\n\n    # git clone git://github.com/josephg/ShareJS.git\n    # cd ShareJS\n    # npm install redis   # If you want redis support\n    # npm link\n\nRun the tests:\n\n    # cake test\n\nBuild the coffeescript into .js:\n\n    # cake build\n    # cake webclient\n\nRun the example server:\n\n    # bin/exampleserver\n\nRunning a server\n----------------\n\nThere are two ways to run a sharejs server:\n\n1. Embedded in a node.js server app:\n\n    ```javascript\n    var connect = require('connect'),\n        sharejs = require('share').server;\n\n    var server = connect(\n          connect.logger(),\n          connect.static(__dirname + '/my_html_files')\n        );\n\n    var options = {db: {type: 'none'}}; // See docs for options. {type: 'redis'} to enable persistance.\n\n    // Attach the sharejs REST and Socket.io interfaces to the server\n    sharejs.attach(server, options);\n\n    server.listen(8000);\n    console.log('Server running at http://127.0.0.1:8000/');\n    ```\n    The above script will start up a ShareJS server on port 8000 which hosts static content from the `my_html_files` directory. See [bin/exampleserver](https://github.com/josephg/ShareJS/blob/master/bin/exampleserver) for a more complex configuration example.\n\n    > See the [Connect](http://senchalabs.github.com/connect/) or [Express](http://expressjs.com/) documentation for more complex routing.\n\n2. From the command line:\n\n        # sharejs\n    Configuration is pulled from a configuration file that can't be easily edited at the moment. For now, I recommend method #1 above.\n\n3. If you are just mucking around, run:\n\n        # sharejs-exampleserver\n  \n    This will run a simple server on port 8000, and host all the example code there. Run it and check out http://localhost:8000/ . The example server stores everything in ram, so don't get too attached to your data.\n\n    > If you're running sharejs from source, you can launch the example server by running `bin/exampleserver`.\n\n\nPutting Share.js on your website\n--------------------------------\n\nIf you want to get a simple editor working in your webpage with sharejs, here's what you need to do:\n\nFirst, get an ace editor on your page:\n\n```html\n<div id=\"editor\"></div>\n```\n\nYour web app will need access to the following JS files:\n\n- Ace (http://ace.ajax.org/)\n- Browserchannel\n- ShareJS client and ace bindings.\n\nAdd these script tags:\n\n```html\n<script src=\"http://ajaxorg.github.com/ace/build/src/ace.js\"></script>\n<script src=\"/channel/bcsocket.js\"></script>\n<script src=\"/share/share.js\"></script>\n<script src=\"/share/ace.js\"></script>\n```\n\nAnd add this code:\n\n```html\n<script>\n    var editor = ace.edit(\"editor\");\n\n    sharejs.open('hello', 'text', function(error, doc) {\n        doc.attach_ace(editor);\n    });\n</script>\n```\n\n> **NOTE:** If you're using the current version in npm (0.4) or earler, the argument order is the other way around (`function(doc, error)`).\n\nThats about it :)\n\nThe easiest way to get your code running is to check sharejs out from source and put your html and css files in the `examples/` directory. Run `bin/exampleserver` to launch the demo server and browse to http://localhost:8000/your-app.html .\n\nSee the [wiki](https://github.com/josephg/ShareJS/wiki) for documentation.\n\nIts also possible to use sharejs without ace. See the textarea example for details.\n\nWriting a client using node.js\n------------------------------\n\nThe client API is the same whether you're using the web or nodejs.\n\nHere's an example application which opens a document and inserts some text in it. Every time an op is applied to the document, it'll print out the document's version.\n\nRun this from a couple terminal windows when sharejs is running to see it go.\n\n```javascript\nvar client = require('share').client;\n\n// Open the 'hello' document, which should have type 'text':\nclient.open('hello', 'text', 'http://localhost:8000/sjs', function(error, doc) {\n    // Insert some text at the start of the document (position 0):\n    doc.insert(\"Hi there!\\n\", 0);\n\n    // Get the contents of the document for some reason:\n    console.log(doc.snapshot);\n\n    doc.on('change', function(op) {\n        console.log('Version: ' + doc.version);\n    });\n\n    // Close the doc if you want your node app to exit cleanly\n    // doc.close();\n});\n```\n\n> **NOTE:** If you're using the current version in npm (0.4) or earler, the argument order is the other way around (`function(doc, error)`).\n\nSee [`the wiki`](https://github.com/josephg/ShareJS/wiki) for API documentation, and `examples/node*` for some more example apps.\n\n\n","readmeFilename":"README.md","_id":"share@0.6.0","dist":{"shasum":"cb81b76cce6065a4f8ae76a885b919fe460530d7","tarball":"http://registry.npmjs.org/share/-/share-0.6.0.tgz"},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"josephg","email":"josephg@gmail.com"},"maintainers":[{"name":"josephg","email":"josephg@gmail.com"}],"directories":{}},"0.6.2":{"name":"share","version":"0.6.2","description":"A database for concurrent document editing","keywords":["operational transformation","ot","concurrent","collaborative","database","server"],"homepage":"","author":{"name":"Joseph Gentle","email":"josephg@gmail.com"},"dependencies":{"sockjs":">= 0.3.1","socket.io":"~0.8","socket.io-client":"~0.8","browserchannel":"*","ws":"*","connect":"<3.x","request":">= 2.1.1","coffee-script":"<1.7","hat":"*"},"devDependencies":{"express":"~ 3.x","optimist":">= 0.2.4","nodeunit":"*","shelljs":"*","uglify-js":"~1","websocket":"*"},"engine":"node >= 0.6","main":"index.js","bin":{"sharejs":"bin/sharejs","sharejs-exampleserver":"bin/exampleserver"},"scripts":{"build":"cake build","test":"cake test","prepublish":"cake webclient"},"licenses":[{"type":"MIT"}],"repository":{"type":"git","url":"http://github.com/josephg/sharejs.git"},"readme":"ShareJS\n=======\n\nThis is a little server (& client library) to allow concurrent editing of any kind of content. The server runs on NodeJS and the client works in NodeJS or a web browser.\n\nShareJS currently supports operational transform on plain-text and arbitrary JSON data.\n\n**Immerse yourself in [API Documentation](https://github.com/josephg/ShareJS/wiki).**\n\n**Visit [Google groups](https://groups.google.com/forum/?fromgroups#!forum/sharejs) for discussions and announcements**\n\n**Check out the [live interactive demos](http://sharejs.org/).**\n\n> Note: CI sometimes breaks for random reasons even though the tests work locally. Don't stress!\n[![Build Status](https://secure.travis-ci.org/josephg/ShareJS.png)](http://travis-ci.org/josephg/ShareJS)\n\n\nBrowser support\n---------------\n\nShareJS **should** work with all of them ![logos of all of all the browsers](http://twitter.github.com/bootstrap/assets/img/browsers.png)\n\nThat said, I only test regularly with FF, Safari and Chrome, and occasionally with IE8+. **File bug reports if you have issues**\n\n\nInstalling and running\n----------------------\n\n    # npm install share\n\nRun the examples with:\n\n    # sharejs-exampleserver\n\nIf you want redis support, you'll need to install redis:\n\n    # brew install redis\n    # npm install -g redis\n\n### From source\n\nInstall redis (optional)\n    \n* Mac:\n\n        # brew install redis\n\n* Linux:\n   \n        # sudo apt-get install redis\n\nThen:\n\n    # git clone git://github.com/josephg/ShareJS.git\n    # cd ShareJS\n    # npm install redis   # If you want redis support\n    # npm link\n\nRun the tests:\n\n    # cake test\n\nBuild the coffeescript into .js:\n\n    # cake build\n    # cake webclient\n\nRun the example server:\n\n    # bin/exampleserver\n\nRunning a server\n----------------\n\nThere are two ways to run a sharejs server:\n\n1. Embedded in a node.js server app:\n\n    ```javascript\n    var connect = require('connect'),\n        sharejs = require('share').server;\n\n    var server = connect(\n          connect.logger(),\n          connect.static(__dirname + '/my_html_files')\n        );\n\n    var options = {db: {type: 'none'}}; // See docs for options. {type: 'redis'} to enable persistance.\n\n    // Attach the sharejs REST and Socket.io interfaces to the server\n    sharejs.attach(server, options);\n\n    server.listen(8000);\n    console.log('Server running at http://127.0.0.1:8000/');\n    ```\n    The above script will start up a ShareJS server on port 8000 which hosts static content from the `my_html_files` directory. See [bin/exampleserver](https://github.com/josephg/ShareJS/blob/master/bin/exampleserver) for a more complex configuration example.\n\n    > See the [Connect](http://senchalabs.github.com/connect/) or [Express](http://expressjs.com/) documentation for more complex routing.\n\n2. From the command line:\n\n        # sharejs\n    Configuration is pulled from a configuration file that can't be easily edited at the moment. For now, I recommend method #1 above.\n\n3. If you are just mucking around, run:\n\n        # sharejs-exampleserver\n  \n    This will run a simple server on port 8000, and host all the example code there. Run it and check out http://localhost:8000/ . The example server stores everything in ram, so don't get too attached to your data.\n\n    > If you're running sharejs from source, you can launch the example server by running `bin/exampleserver`.\n\n\nPutting Share.js on your website\n--------------------------------\n\nIf you want to get a simple editor working in your webpage with sharejs, here's what you need to do:\n\nFirst, get an ace editor on your page:\n\n```html\n<div id=\"editor\"></div>\n```\n\nYour web app will need access to the following JS files:\n\n- Ace (http://ace.ajax.org/)\n- Browserchannel\n- ShareJS client and ace bindings.\n\nAdd these script tags:\n\n```html\n<script src=\"http://ajaxorg.github.com/ace/build/src/ace.js\"></script>\n<script src=\"/channel/bcsocket.js\"></script>\n<script src=\"/share/share.js\"></script>\n<script src=\"/share/ace.js\"></script>\n```\n\nAnd add this code:\n\n```html\n<script>\n    var editor = ace.edit(\"editor\");\n\n    sharejs.open('hello', 'text', function(error, doc) {\n        doc.attach_ace(editor);\n    });\n</script>\n```\n\n> **NOTE:** If you're using the current version in npm (0.4) or earler, the argument order is the other way around (`function(doc, error)`).\n\nThats about it :)\n\nThe easiest way to get your code running is to check sharejs out from source and put your html and css files in the `examples/` directory. Run `bin/exampleserver` to launch the demo server and browse to http://localhost:8000/your-app.html .\n\nSee the [wiki](https://github.com/josephg/ShareJS/wiki) for documentation.\n\nIts also possible to use sharejs without ace. See the textarea example for details.\n\nWriting a client using node.js\n------------------------------\n\nThe client API is the same whether you're using the web or nodejs.\n\nHere's an example application which opens a document and inserts some text in it. Every time an op is applied to the document, it'll print out the document's version.\n\nRun this from a couple terminal windows when sharejs is running to see it go.\n\n```javascript\nvar client = require('share').client;\n\n// Open the 'hello' document, which should have type 'text':\nclient.open('hello', 'text', 'http://localhost:8000/sjs', function(error, doc) {\n    // Insert some text at the start of the document (position 0):\n    doc.insert(\"Hi there!\\n\", 0);\n\n    // Get the contents of the document for some reason:\n    console.log(doc.snapshot);\n\n    doc.on('change', function(op) {\n        console.log('Version: ' + doc.version);\n    });\n\n    // Close the doc if you want your node app to exit cleanly\n    // doc.close();\n});\n```\n\n> **NOTE:** If you're using the current version in npm (0.4) or earler, the argument order is the other way around (`function(doc, error)`).\n\nSee [`the wiki`](https://github.com/josephg/ShareJS/wiki) for API documentation, and `examples/node*` for some more example apps.\n\n\n","readmeFilename":"README.md","_id":"share@0.6.2","dist":{"shasum":"577b5d55cf808ca155c429c5f87e65c3e3f6dfd0","tarball":"http://registry.npmjs.org/share/-/share-0.6.2.tgz"},"_from":".","_npmVersion":"1.2.17","_npmUser":{"name":"josephg","email":"josephg@gmail.com"},"maintainers":[{"name":"josephg","email":"josephg@gmail.com"}],"directories":{}}},"maintainers":[{"name":"josephg","email":"josephg@gmail.com"}],"time":{"0.1.0":"2011-04-20T14:04:29.574Z","0.1.1":"2011-04-30T00:59:18.080Z","0.2.1":"2011-07-06T06:54:04.064Z","0.2.2":"2011-07-15T14:45:24.782Z","0.3.0":"2011-08-14T05:51:53.200Z","0.4.0":"2011-09-17T17:01:14.378Z","0.4.1":"2011-09-19T13:17:32.493Z","0.5.0-pre":"2011-11-05T17:06:44.929Z","0.5.0":"2012-07-14T03:42:28.623Z","0.6.0":"2013-04-10T19:13:32.518Z","0.6.2":"2013-04-20T03:03:02.014Z"},"author":{"name":"Joseph Gentle","email":"josephg@gmail.com"},"repository":{"type":"git","url":"http://github.com/josephg/sharejs.git"},"_attachments":{"share-0.6.2.tgz":{"content_type":"application/octet-stream","revpos":30,"digest":"md5-AuTabUd6lDsns53+zbcvvA==","length":691969,"stub":true},"share-0.6.0.tgz":{"content_type":"application/octet-stream","revpos":28,"digest":"md5-RfH7lgzJUDUCLLNytODzrQ==","length":660094,"stub":true},"share-0.5.0.tgz":{"content_type":"application/octet-stream","revpos":27,"digest":"md5-5rEOHej6CMqqBPUtremo+Q==","length":680815,"stub":true},"share-0.5.0-pre.tgz":{"content_type":"application/octet-stream","revpos":21,"digest":"md5-ovi1GzPgTsShRAeoC1O0DQ==","length":573440,"stub":true},"share-0.4.1.tgz":{"content_type":"application/octet-stream","revpos":15,"digest":"md5-6bQBnIL/cV+eBacV+PoeNg==","length":594813,"stub":true},"share-0.4.0.tgz":{"content_type":"application/octet-stream","revpos":13,"digest":"md5-1JiI5+gXFEOYRtM6oKR4Cg==","length":595504,"stub":true},"share-0.3.0.tgz":{"content_type":"application/octet-stream","revpos":11,"digest":"md5-Bry8bJQlzz+RcCJKQB5c2Q==","length":542535,"stub":true},"share-0.2.2.tgz":{"content_type":"application/octet-stream","revpos":9,"digest":"md5-HNsCunm9PufFSn5bD1B3Wg==","length":411348,"stub":true},"share-0.2.1.tgz":{"content_type":"application/octet-stream","revpos":7,"digest":"md5-t20DpkajAQqy6+fs/u2Q0A==","length":379093,"stub":true},"share-0.1.1.tgz":{"content_type":"application/octet-stream","revpos":5,"digest":"md5-ZOcDQMj7ob3rafw4J9Ed/Q==","length":347752,"stub":true},"share-0.1.0.tgz":{"content_type":"application/octet-stream","revpos":3,"digest":"md5-Rp0xXXfvmntn/2CAT/2E4A==","length":348208,"stub":true}}}