background preloader

Nodejs

Facebook Twitter

How to create an Ubuntu (deb) installer (for NodeJS apps) Watch on YouTube: youtu.be/FY7Cx6XnpZ4 The Installer Trifecta Series If you're the intelligent and impatient type: Skip down to Building the deb and see the final steps and then glance back up at Getting Started to see the directory structure.

How to create an Ubuntu (deb) installer (for NodeJS apps)

How To Install Node.js with NVM (Node Version Manager) on a VPS. Isaacs/node-semver. Goodbye node-forever, hello PM2. It’s no secret that the devo.ps team has a crush on Javascript; node.js in the backend, AngularJS for our clients, there isn’t much of our stack that isn’t at least in part built with it.

Goodbye node-forever, hello PM2

Our approach of building static clients and RESTful JSON APIs means that we run a lot of node.js and I must admit that, despite all of it awesomeness, node.js still is a bit of a headache when it comes to running in production. Tooling and best practices (think monitoring, logging, error traces…) are still lacking when compared to some of the more established languages.

So far, we had been relying on the pretty nifty node-forever. Great tool, but a few things were missing: Limited monitoring and logging abilities, Poor support for process management configuration, No support for clusterization, Aging codebase (which meant frequent failures when upgrading Node). This is what led us to write PM2 in the past couple months. So what’s in the box? First things first, you can install it with npm: Then; $ pm2 list. Substack/bouncy. Megablue's playground: Run Node on port 80 with non-root user privileges. I had been toying around wtih Node.js these few days.

megablue's playground: Run Node on port 80 with non-root user privileges

With background of PHP programming, I had experience on setting up a proper LAMP server (Linux + Apache + MySQL + PHP) from scratch, I quickly noticed that running Node on port 80 with superuser privilege (binding to port below port number 1024 requires superuser aka root ) triggers my security concerns. Although Node is widely discussed among early technology adpoters but I still wasn't able find sufficient information to run Node on production environment. In general, Node users doesn't speak about binding port 80 while dropping the superuser privileges. After a quick look into the Node documentation, I found the process object which packed with two methods called process.setgid() and process.setuid(). These 2 methods are crucial to prevent the process from accessing files that was not intended for it in case anything goes wrong.

Bellow are the sample code with a bare bone express setup to drop the superuser privileges. Getting started with Node.js, Express and Jade using the WebStorm IDE » Matt Palmerlee. Node.js Over the last few weeks I’ve been experimenting with Node.js and learning about how to use some of the great packages written for it.

Getting started with Node.js, Express and Jade using the WebStorm IDE » Matt Palmerlee

Node.js is a popular framework for building scalable server-side applications in JavaScript. To achieve high concurrency and scalability, Node.js leverages JavaScript’s event loop and function callbacks for longer running processes so that complex concurrent thread locking logic is not required. Manuel Kiessling’s Node Beginner Book goes through a great Node.js tutorial and explains in detail how to call long running processes (such as a database query or disk I/O operation) and not cause the request to block other operations.

Blazing fast node.js: 10 performance tips from LinkedIn Mobile. Running bare or behind nginx for node? HTML5: Server-sent events with Angular.js, Node.js and Express.js. Btford/angular-express-seed. Btford/angular-express-seed. Cowboy-coder/bundle-up. Shtylman/node-enchilada. Browserify and the Universal Module Definition. How I Learned to Stop Worrying and Love the Browserify Defining a module is really simple but like all simple things; none of us can agree on just one.

Browserify and the Universal Module Definition

While this is generally true for all communities it is especially erratic in the javascript community. This is not really javascript's fault though. It's not easy being an extremely flexible, loosely interpreted language available on just about every platform. The current actively used module definitions are: Global Variables var MyModule = function() {}; CommonJS var MyDependency = require('my-dependency'); module.exports = function() {}; define(['my-dependency'], function(MyDependency) { return function() {}; }); Universal Access Typically you want your module to be easily consumed by the users of all of these module definitions. Adunkman/connect-assets. Grunt Boilerplate. What we'll cover reading time: approx. 19mins What is Grunt?

Grunt Boilerplate

InstallationPackage.jsonDependenciesGruntfile.jsSassRequireJSJSHintJasmine BDDImage MinificationHTML MinificationRegistering tasksWatching filesOur full Grunt fileConclusionUpdates Please note that any additional updates have been added to the bottom of this post to ensure no cross-over between the original focus and new items that might contradict that What is Grunt?

Meteor

Oortcloud/unofficial-meteor-faq. Substack/node-browserify. Socket.IO: the cross-browser WebSocket for realtime apps. SEO for single page applications - Backbone.js Tutorials. This tutorial will show you how to index your application on search engines.

SEO for single page applications - Backbone.js Tutorials

As the author I believe that servers should be completely independent of the client in the age of API's. Which speeds up development for the ever increasing array of clients. It is on the shoulders of the search engines to conform and they should not dictate how the web is stored and accessed. In 2009 Google released the idea of escaped fragments. The idea simply stating that if a search engine should come across your JavaScript application then you have the permission to redirect the search engine to another URL that serves the fully rendered version of the page (The current search engines cannot execute much JavaScript (Some people speculate that Google Chrome was born of Google Search wishing to successfully render every web page to retrieve ajaxed content)). How does redirecting bots work? Building Real-time CoffeeScript Web Applications With SocketStream. Our engineering team at Aol Europe have been working on a number of exciting new projects over the past few months including a brand new high-performance real-time web framework called SocketStream.We're going to take a first look at how you can start building applications with it today.

Building Real-time CoffeeScript Web Applications With SocketStream

The brain-child of software engineer Owen Barnes, SocketStream is built on top of node.js, resolves around the popular single-page application (SPA) paradigm and utilizes HTML5 WebSockets, Socket.IO, Redis and other techologies to provide an extremely responsive experience for the web. It's effectively a complete-stack for all of your client and server development needs. The team launched SS at Hacker News London this week and we were humbled by the positive reaction on both GitHub (where we very surprisingly became the trending repo of the week) and Twitter including some interest from Jeremy Ashkenas, the developer behind Backbone.js, Underscore.js and of course, CoffeeScript.

Understanding WebSockets. PhantomJS: Headless WebKit with JavaScript API. Mauricemach/zappa. Passport - Simple, unobtrusive authentication for Node.js. AngularJS and SEO. Turns out it is possible to have your AngularJS application indexed AngularJS and just about all JavaScript MVC frameworks modify the contents of your HTML structure which make the pre-rendered HTML invalid for search engines.

AngularJS and SEO

Luckily there is a way to get around this and to have full SEO support for your AngularJS application by using some special URL routing and a headless browser to retrieve the HTML for you. Continue reading this article to figure out how to make this amazing framework work well with your favourite search engines. This page was first published on November 7th 2012 and was last updated on January 21st 2013. To best follow along with this article, be sure to clone the repo, yearofmoo/AngularJS-SEO-Article and look through the code and compare it to what's on the blog to get a better idea of how everything works. Optimizing AngularJS in HTML5 mode for SEO with node.js and ExpressJS. As I told you recently I want to give some of the techniques I used to make my landing page work away in some posts over the next couple of weeks. Today I will cover the topic of SEO optimizing for an AngularJS app. Current web indexing engines such as the GoogleBot oder Yahoo’s web crawler – and even Bing – have a hard time indexing Javascript only web pages.

Since AngularJS populates the content of your webpage with Javascript after it has been loaded crawlers see only the static content of your homepage. Btford/angular-express-seed. Brian Ford. AngularJS is like the missing Batarang on your utility belt of web development awesomeness.

Brian Ford

It gives you two-way data binding that's both easy to use and fast, a powerful directive system that lets you use create reusable custom components, plus a lot more. Express is an excellent webserver for Node.js that provides routing, middleware, and sessions. Incidentally, the two work quite well together! In this tutorial, I'm going to walk through writing a simple blog app with Angular and Express. Derby. NPM tricks. I decided to put together a little list of tips and tricks related to NPM you might not know about, that come from my experience working with it daily, in both production and development.

Dev dependencies Make sure packages that only need to be installed while developing your module, like test frameworks, are included as devDependencies : "devDependencies" : { "module" : "0.1.0" Express/examples at master · visionmedia/express. Restful: A Better REST API using Node.js with Express - Codenfreude. I’m going to introduce to you how to quickly make a REST API using a library I just built call Restful. Restful, inspired by Tastypie for Django, generates API endpoints to perform CRUD operations on Mongoose models. Restful integrates in Express applications. Right now, the only return type is JSON but I plan on adding support for HTML responses and possibly others. A Simple Website in Node.js with Express, Jade and Stylus by Ben Gourley.

Node Tuts episode 14 - Some Node.js tools. Node Tuts episode 16 - Introduction to Coffeescript and Node.js. Connect - High quality middleware for node.js. Beginner’s Guide to Node.js (Server-side JavaScript) Ember.js - About. What's the currently recommended way to install node.js on Debian? Installing Hubot on Ubuntu. We used to run Hubot on Heroko until it crashed, not sure what happened exactly but we didn't bother bring it back due more pressing issues within our company. Then I saw one of the most georgeous presentations ever, Intergalactic Javascript Robots from Outer Space, and it got me excited to run a Hubot again. Understanding Backbone.js and the Server.

Understanding Backbone.js and the Server. Underscore.js. Grunt: The JavaScript Task Runner. MongoDB Many-to-Many Relationship Data Modeling - Mark Starkman. Sebmaster's experiments: Multi-user synchronization with racer and angular.js. Overview. BOWER: A package manager for the web.

Derby. Blazing fast node.js: 10 performance tips from LinkedIn Mobile. Sebmaster/racer-example. Writing Hubot Plugins with CoffeeScript. One Jar To Rule Them All: Installing And Running Hubot, Terminator is Here. In current post we are going to see how to install hubot and make it work over XMPP protocol (using open fire server), and how can help us during our daily work. Hubot is a robot which belongs to your chat infrastructure as one more user, which you can talk with him. Hubot can help you automate a lot of tasks, like deploy a site, manage your Pomodoro, or managing issue system to cite a few of them. Intergalactic Javascript Robots from Outer Space. Writing Hubot Plugins with CoffeeScript.