node.js

Node.js hosting platform Heroku-like

Hi, I want to create something similar to Heroku (first I was thinking in EngineYard-like but I prefer Heroku) for node.js (I know they already support node.). However, It's for a personal project so it doesn't need to be anything overcomplicated or super expensive. I believe I can learn a lot creating a product like this. Before I sta...

Is concurrent access to shared array a problem in Node.js

How is node handling events? One at the time, or concurrent? I need to know, if there is going to be concurrent access to a shared array, like in the following example: var ws = require("./ws.js"), connections = []; ws.createServer(function( socket ){ // add to connection array socket.on('connect', function(){ c...

Javascript frameworks used on server side to extend Javascript core?

There are a lot of frameworks for the frontend: jQuery Prototype Mootools YUI ExtJS Dojo Could these be used on the server side to extend Javascript native classes for example: object2 = object1.clone(); And is this a good way of extending Javascript? Cause I don't want to create every basic function I need but lacks from Javascr...

How to use YUI3 on node?

I can't get YUI3 to work on node. I have installed all dependencies according to this site: http://github.com/yui/nodejs-yui3. Here is my code: var jsdom = require("jsdom").jsdom, window = jsdom("<html><head></head><body>hello world</body></html>").createWindow(); var puts = require("sys").puts; var YUI = require("yui3").YUI; v...

Node.js, process and threads question

Does process have at least one thread running? If so, then the Node.js will by default have 1 main thread and 1 event loop thread running? ...

Basic node.js question: handling an exception

Hey all, Consider the following code: var meryl = require('meryl'), merylex = require('meryl-extras'), staticfile = merylex('staticfile'), httpserv = require('http'); meryl.p('GET /static/<filepath>', staticfile({root: 'static', path: 'filepath'})); httpserv.createServer(meryl.cgi()).listen(3000); This works great, until you ...

Deactivate INFO messages for YUI3 on node.js?

I'm using YUI3 on node.js but I get all these INFO messages. How do I deactivate them? ...

Is there a job scheduler library for node.js?

Is there some cron like library that would let me schedule some function to be ran at certain time (15:30 for example, not x hours from now etc)? If there isn't this kind of library how this should be implemented? Should I just set callback to be called every second and check the time and start jobs scheduled for the time or what? ...

NPM Install Issues Ubuntu 9.04

All, Trying to install NPM using the commands from here: http://howtonode.org/introduction-to-npm Specifically, when I run: curl http://npmjs.org/install.sh | sh This is the error I get... node cli.js cache clean TypeError: Object #<an EventEmitter> has no method 'on' at Object.<anonymous> (/home/sanjay/npm-1285345468/lib/utils/rm-r...

Node.js provide an efficiency in doing nothing?

I heard a speaker described Node.js as a webserver that "efficiently does nothing". I thought it was a joke but others looked to nod agreement. Can someone explain my misunderstanding of this phrase? ...

How to create video,audio chat system in rails,ruby or using node

I want to build video/audio chat application for my one of the social apps.Is there any library are available in java or ruby or node.js that can help us to build audio/video chat application. Or any suggestion/technical article that help us to build video chat application. ...

Stream with Node.js doesn't work

I know that with Node.js you can stream data. But why doesn't this code work: var sys = require('sys'), http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/html'}); res.write("hello"); res.write("world"); }).listen(80); Seems that I have to have res.end() after the las...

node.js: Enumerating socket clients...

Hi, I'm trying to create a server app in node.js, where multiple clients connect, and then one sends data, and that data gets send to another specific client. Which client it gets sent to is determined by a 'user id' that all clients will send after they connect. How can I keep track of clients as they connect? How can I find my specif...

Javascript FAB framework on Node.js

I've seen a slide that presented Fab, a node.js framework. Is this JavaScript? Could someone explain what is going on in that code? I'm all lost. ...

Detect file changes in node.js via watchFile

I want to detect changes for a file, if the file changes, I will use child_process to execute a scp command to copy the file to a server.I looked up node.js documentation, the fs.watchFile function seems do what I want to do, but when I tried it, somehow it just doesn't work as I expected. The following code were used: var fs = require(...

node.js Nerve framework unicode response

code: var nerve = require("./nerve"); var sitemap = [ ["/", function(req, res) { res.respond("Русский"); }] ]; nerve.create(sitemap).listen(8100); show in browser: CAA:89 How it should be correct? ...

Long-running computations in node.js

I'm writing a game server in node.js, and some operations involve heavy computation on part of the server. I don't want to stop accepting connections while I run those computations -- how can I run them in the background when node.js doesn't support threads? ...

Choosing a web application framework (using Node.js)

I've recently "discovered" Node.js, and after I was finished having my mind blown, I started looking for a web application framework like Django or Codeigniter that uses Node.js. The main reasons I found online for using a Node.js-based framework were: Impressive scalability and speed, especially regarding simultaneous connections Same...

node.js - overloading functions

Is there a way to overload functions in node.js similar to _noSuchMethod_ https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/noSuchMethod? Thanks ...

Is there a general mechanism to timeout events in node.js?

I am learning node.js and most of examples I can find are dealing with simple examples. I am more interested in building real-world complicated systems and estimating how well event based model of node.js can handle all the use cases of a real application. One of the common patterns that I want to apply is let blocking execution to time...