Package Exports
- now
- now/lib/nowUtil
- now/package.json
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (now) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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>
Further Reading
Now that you have NowJS, try the NowJS User Manual and Quick Chat Example
Have more questions? You can reach us in #nowjs on freenode