I am Hack Sparrow
Captain of the Internets.

Loading JavaScript Modules in the Browser with Component.js

Is there a way to enable the module loading capability of Node.js in the browser? How wonderful it would be if you could write JavaScript modules the Node.js way and load them in the browser. There have been many attempts at doing this. Notable among them are RequireJS and Browserify. Both got things done one or the other way, but are unnecessarily complicated and a pain to use. If you type "browserify" or "requirejs" ...

Detect Browser / User-Agent in Express.js (Node.js)

In Express.js the details of the HTTP User-Agent making the request to a URL is available in the req.headers object's user-agent property. [code] req.headers['user-agent'] [/code] Node.js will not be able to detect the browser if it doesn't have access to the req object, so the detection process should be done in a route handler or through one (pass the req object). In this example, ...