node.js

Connector between node.js and Scala (Java)

What is the best way of integrating node.js with Scala (Java)? The simplest way I see so far is using Redis PubSub as a mediator, with node.js server handling HTTP requests and publishing messages to the request channel (via redis-node-client), and Scala actors (e.g. Akka Redis PubSub integration) subscribed the request channel and publi...

How to use JSON2 in Node.js

I want to use json2 as JSON.parse in node.js, (forgive the stupid question) I can't quite figure out how to use it. I have a copy of json2.js, with the first line removed in my current working directory. Then, from the node.js shell i do: > orig_func = JSON.parse [Function: parse] > require('json2') { JSON: {} } > orig_func === JSON.par...

(Node.js) application that lets me edit a local file through a web browser?

I wonder if there is a Node.js application that starts a server on the current folder to let me edit files through the web browser? Kinda like http://www.cloud9ide.com, but for general editing (scripts, text etc). ...

Node.js: Connecting to a Server Using Sockets

I'm just starting to play with Node.js today, and thought I'd start with what I thought would be a simple script: Connecting to a server via sockets, and sending a bit of data, and receiving it back. I'm creating a command line utility. Nothing in the browser. An example of a server would be memcached, beanstalkd, etc. It seems the net ...

Node.js installation: openssl not installed

I have installed libssl-dev and openssl but I get this when I install node.js: > ./configure && make && make install Checking for program g++ or c++ : /usr/bin/g++ ...

Standard Inheritance System for node.js and browsers (including IE6)?

Hi I am looking for a Standard Inheritance System that can work in both node.js and browsers. sys.inherits doesn't work in old browsers (Object.create). All js libraries (jquery, extjs, dojo...) have similar but diff inherit systems. (Don't know which one is good for node.js) Want to use one which is simple and may become the "standa...

[node.js] new to node.js - "http.Server" events.

How can we listen to "http.Server" events? Or how can we instantiate a "http.Server" object? According to nodejs.org/api.html: "http.Server" is an EventEmitter with events like "request", "connection" .. etc. However I can't find a way to listen to these event as I am not sure how to instantiate a "http.Server" object. All examples I ...

Low-level javascript framework that abstracts away html/css?

Honestly, now when we have so many javascript features on the frontend I really wish javascript in the browsers could replace html and css entirely. We could deal with objects (structure + design + functionality) instead of html elements and css that style these elements. But since that is never going to happen, I wonder if there is an...

jQuery plugins with node.js

I'm using jQuery with jsdom in my node.js app. Moreover, I want to use jQuery plugins(e.g. jQuery.diff), but I cannot find how to do this. Is there any way out? ...

Are closures different in node.js?

I have worked quite a lot with javascript but yesterday, I started using node.js. It's a little script that runs jslint on the files of a folder. For this example, I changed the command to call ls instead of jslint. var sys = require("sys"); var fs = require("fs"); var cp = require('child_process'); var path = fs.realpathSync("./src/")...

How can I create and interact with a canvas element in node.js?

I'm writing a canvas-powered multiuser drawing application in Node.js, and want to maintain an internal canvas element with the current drawing. Is it possible to create and interact with a canvas element in Node.js? My latest try was the jsdom module available here: http://github.com/tmpvar/jsdom var jsdom = require('jsdom'); var win...

In a node.js application, how can I asynchronously achieve the effect of a rails controller before_filter?

I have a node.js Express application with a basic user authentication system where the session is stored in redis. I'd like to write and re-use a current_user() function that populates a JSON representation of the logged in user (if there is one) in a current_user variable. Here is the code to retrieve the user: if( req.cookie('fingerpr...

Node.JS General Comet Inquiry

I'm trying to take up node.js for a comet-based program. Essentially I'm going to have information coming in from either an SQL database or a XML feed, but the end result needs to be the same. I'm confused upon the implementation and here's my road blocks, help would be greatly appreciated. Streaming - I've been able to build simple mo...

How to I load a javascript file using express and node.js?

I'm trying to figure out how to load a simple javascript client-side library while using node.js and express. Any ideas? See below. HAML: %script{type: 'text/javascript', src: '/jquery-1.4.3.js'} %script{type: 'text/javascript', src: '/client.js'} app.js: app.get('/*.js', function(req, res) { res.render(req.params + '.js', { layo...

Javascript IDE that forces strict typing, semicolons, and validates code like JSLint (or: that adds the advantages of a compiler to Javascript)?

I'm looking for ways to make developing big server sided Javascript (I'm working with Node.js) projects a whole lot easier. Basically, the problems I'm facing with Javascript is that I'm not being warned when I make a syntax error, or when I mix different kinds of object types in the same arrays/variables etc. I was using haXe to solve...

Best way to connect node.js and sphinx

I'm trying to search in sphinx from node.js code. The only way to do it I know is to connect to searchd as to mysqld server. I'd absolutely all known mysql libraries, but no of them even connected to sphinx. ...

Is there a node.js implementation of an OpenID consumer?

Looking for an OpenID consumer in node.js It is not on this list http://openid.net/developers/libraries/ Is there one? ...

Howto move from object based language to server side Node.js Javascript for big projects?

Hi there, I've decided to get used to using Javascript as my server sided (I'm using Node.js) language to setup a webserver, create server deamons and a lot more. This is a rather big project, which means that I have to get used to the language and get myself an optimal setup before actually starting to avoid overhead and unneeded hassl...

Base64 decode from Buffer to Buffer efficiently in node (node.js)

I currently have a python and C version of wsproxy (WebSockets to plain TCP socket proxy) in noVNC. I would like to create a version of wsproxy using node.js. A key factor (and the reason I'm not just using existing node WebSocket code) is that until the WebSocket standard has binary encoding, all traffic between wsproxy and the browser/...

Node.js as a background service

I want my node.js server to run in the background, ie: when I close my terminal I want my server to keep running. I've googled this and came up with this tut, however it doesn't work as intended. So instead of using that daemon script, I thought I just used the output redirection (the 2>&1 >> file part), but this too does not exit (I get...