I was impressed with substack's 
article http://substack.net/posts/9bac3e/Roll-your-own-PubSub-with-DNode, 
but I cannot reproduce it.

client.js: 

var dnode = require('dnode');
var domready = require('domready');
domready(function () {
dnode.connect(3001, function (remote, conn) {
console.log('here we are');
remote.cat(function (says) {
var elem = document.getElementById('says');
elem.innerHTML = says;
});
});
});

server.js:

var express = require('express');
var app = express.createServer();

var dnode = require('dnode');

app.use(express.static(__dirname));

dnode(function (client) {
    this.cat = function (cb) {
cb('meow');
};
}).listen(3001).listen(app.listen(8080));

index.html:

<html>
<head>
<script src="dnode.js" type="text/javascript"></script>
</head>
<body>
The cat says <span id="says">?</span>.
</body>
</html>

after browserifying client.js -> dnode.js I recieve following exception: 

Uncaught TypeError: Object function (cons, opts) { return new dnode(cons, 
opts); } has no method 'connect' 


Has anyone experienced this?

 Tnx

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to