Skip to content
NowJS makes it easy to build real-time web apps using JavaScript
Pull request Compare This branch is 90 commits ahead, 309 commits behind Flotype:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
examples
lib
best_practices.md
changelog.txt
getting_started.md
package.json
readme.md
user_manual.md

readme.md

Get NowJS

NowJS is a NodeJS module. The client javascript (now.js) is served by the NowJS server.

Go to Github or Download the tgz

Install From npm

npm install now

NowJS uses the excellent socket.io and node-proxy libraries and portions of sesame

2 Step Setup

1. On the server

var httpServer = require('http').createServer(function(req, response){ /* Serve your static files */ })
httpServer.listen(8080);

var everyone = require("now").initialize(httpServer);
everyone.now.msg = "Hello World!";

2. On the client


<script type="text/javascript" src="http://localhost:8080/nowjs/now.js"></script>

<script type="text/javascript">
  now.ready(function(){
    // alerts "Hello World!"
    alert(now.msg);
  });
</script>

FAQ

Q: Can I pass in a callback or closure, for example, if the remote function is asynchronous??

A: Yes. This is 100% supported

Q: How do I use NowJS with Express?

A: Very easily. var app = express.createServer(); app.listen(3000); var everyone = require("now").initialize(app);

Further Reading

Now that you have NowJS, try the NowJS User Manual and Quick Chat Example

Have more questions? Please contact us: Email: team@nowjs.com IRC: #nowjs on freenode Twitter: @NowJSTeam

Something went wrong with that request. Please try again.