These days there is now ShareJS. You should probably use that instead.
Nowpad is no longer maintained and the now dependency that nowpad depends on no longer works. Theoritically, the now
dependency could be swapped out for primus, which should take about half a day, but that is not guaranteed to work.
NowPad adds realtime text collaboration to parts of your website such as textareas, allowing multiple people to work on the same document at the same time (while seeing each others changes as they are applied). The benefit of this over traditional collaborative editing is two people would be editing the same document, they've both made changes, one person saves, and the other has to make the choice 'lose my changes, or lose his changes'. Nowpad keeps and applies both your changes as they happen.
- Use:
require('nowpad')
- Install:
npm install --save nowpad
- Node.js - Server Side Javascript
- Express.js - The "Server" in Server Side Javascript
- Now.js - Server and Client Side Communication
- CoffeeScript - JavaScript Made Easy
- Buildr - (Java|Coffee)Script Bundling Made Easy
-
Clone and setup this repo
git clone https://github.com/balupton/nowpad.git nowpad cd nowpad npm install npm link
-
Start the demo app
nowpad # or npm start if inside nowpad directory
// Include NowPad
var nowpad = require('nowpad')
// Setup with your Express Server
var myNowpad = nowpad.createInstance({server: yourExpressServer})
//Create known documents
myNowpad.addDocument('doc1', 'this is doc1')
myNowpad.addDocument('doc2', 'this is doc2')
// Handle unknown document
// Fires when an unknown document is requested
myNowpad.requestDocument(function(documentId, callback){
// nowpad.addDocument(documentId)
// callback(true)
callback false
})
// Handle sync request
// Fires when a change is synced to the document
myNowpad.bind('sync', function(document, value){
})
// Handle disconnect request
// Fires when all the clients have disconnected from a document
myNowpad.bind('disconnected', function(document, value){
})
-
Include Dependencies
<script src="/nowjs/now.js"></script> <script src="/nowpad/nowpad.js"></script>
-
Using NowPad with a Textarea
// Without jQuery window.nowpad.createInstance({ element: document.getElementById('myTextarea'), documentId: 'doc1' }); // Or With jQuery $textarea = $('#myTextarea').nowpad('doc1');
-
Using NowPad with ACE
window.nowpad.createInstance({ element: ace.edit('pad'), documentId: 'doc1' });
Discover the change history by heading on over to the HISTORY.md
file.
Discover how you can contribute by heading on over to the CONTRIBUTING.md
file.
These amazing people are maintaining this project:
- Benjamin Lupton b@lupton.cc (https://github.com/balupton)
No sponsors yet! Will you be the first?
These amazing people have contributed code to this project:
Licensed under
Copyright © 2011+ Benjamin Lupton b@lupton.cc (https://github.com/balupton)