Deploying Node.js application services

In Jenkins, automatically test an npm package, then publish if tests succeed

(Wed Aug 14 2019 00:00:00 GMT+0300 (Eastern European Summer Time)) We want to automate the boring stuff so we have more time for interesting stuff. Clearly running tests and administrivia like publishing a Node.js package to npm, well, that's boring stuff. It is the same tasks every time, and as an unautomated process you might forget a step, so let's look at how to automate this common workflow for Node.js programmers.

Deploy Ghost blogging system using Passenger on Dreamhost or other hosting providers

(Tue Mar 06 2018 00:00:00 GMT+0200 (Eastern European Standard Time))

Ghost is a very popular blogging platform which, because it's written in Node.js, is not what you'd expect to install on a traditional web hosting provider who supports PHP. Dreamhost is one of the many dozens or hundreds of web hosting providers whose bread-and-butter is PHP application hosting. Dreamhost, for example, has a specially configured Wordpress hosting service, Dreampress, that looks very useful. However, Dreamhost also allows hosting of Node.js applications. Let's see how to get Ghost running on a Dreamhost Virtual Private Server.

Deploy Node.js application using Passenger on Dreamhost or other hosting providers

(Mon Jan 08 2018 00:00:00 GMT+0200 (Eastern European Standard Time))

On regular web hosting PHP rules the world, and you might think Node.js has no chance. I haven't cross-checked among current web hosting providers, but Dreamhost does offer the option of hosting Ruby or Node.js applications on a VPS using Passenger. In case you've never heard of Passenger, it is an "app server" for hosting Ruby, Python or Node.js applications. Dreamhost supports all three, but for our purpose we're interested in using this to run a Node.js app.

Deprecating buggy npm packages, dealing with deprecations

(Thu Aug 25 2016 00:00:00 GMT+0300 (Eastern European Summer Time)) It seems several critical npm packages deprecated older releases. Installing the old version of some packages causes npm to print a warning saying the package was deprecated, and to use a newer version of the package. Sometimes the message suggests a way to figure out where the package is being required. Due to the way an npm package can pull in other npm packages, it can be tricky to figure out where the deprecated package version is being used.

Is Node.js / Express scalable? How to grow Node.js app deployment to handle more traffic?

(Sun May 01 2016 00:00:00 GMT+0300 (Eastern European Summer Time)) Since Node.js is billed as being very fast, high performance, application development platform, you might think it automatically "scales" to fill out server resources and satisfy a huge workload. While you can do this with a Node.js application, you have to design the scaling mechanism yourself. With no additional configuration, a Node.js application can saturate a single CPU core and handle as many transactions as that core can sustain. That doesn't help when your manager asks why that 32 core server you just ordered has 31 idle CPU cores and one running flat out. Out of the box Node.js doesn't scale, but it's possible to make it do so.

Safely detect if a Node.js module is installed before using require() to load it

(Tue May 05 2015 00:00:00 GMT+0300 (Eastern European Summer Time)) Sometimes you need to detect whether a Node.js module is installed, and print a useful error message if it isn't. For example Grunt does this. The instructions are to install "grunt-cli" then add "grunt" to the package.json for the project for which you want to use Grunt. If you haven't installed grunt locally, typing "grunt" gives you a nice error message telling you what to do. It does that instead of printing an ugly message from the "require" function saying your module wasn't loaded.

Easily deploy files or directory hierarchies to a server using Grunt

(Tue Mar 03 2015 00:00:00 GMT+0200 (Eastern European Standard Time)) Something we geeks need to do all the time is deploy files between machines. Such as, deploying a directory hierarchy over to a server for staging or production use. There's a ton of ways to do this. The old-school way is a shell script with carefully crafted rsync commands. In my case I build websites using (akashacms.com) AkashaCMS and need to deploy them to the destination webserver. Until now I'd added a command to AkashaCMS solely for deployment, but I'm experimenting with Grunt to see how much can be done using the Grunt ecosystem rather than having to maintain code in AkashaCMS.

Distributing, publicly or privately, Node.js modules without using npm repository

(Sun Sep 07 2014 00:00:00 GMT+0300 (Eastern European Summer Time)) The default assumption for distributing a Node.js module is to publish it in the public npm registry. It's a simple declaration in the package.json, and then you tell your customers to simply type "npm install". The public npm registry takes care of the details, and you can even use versioning to make sure your customers use tested module versions. But what if you don't want to publish modules in the public npm registry? Maybe your modules are proprietary, or maybe the modules are too intertwined with a parent product to be of general use?

Installing MongoDB on Mac OS X Mavericks for Node.js development

(Fri Jan 17 2014 00:00:00 GMT+0200 (Eastern European Standard Time)) How do you upload files to a server to deploy application or website code?  FTP?  rsync?  While it's easy enough to call a command line tool like rsync from a Node.js script, what if you're using a Windows computer that doesn't have those command line tools.  When I use Windows it's like stepping back into the dark ages where directory listings looked like we were making fire by rubbing sticks together.  Okay, there does appear to be an rsync for Windows but I had no confidence in it.  Also, I did not want to have a dependency on something like Cygwin.

MacOS X setup for Node.js development - Installing Node

(Mon Dec 09 2013 00:00:00 GMT+0200 (Eastern European Standard Time)) I'm setting up a new Mac, rather, I'm doing a clean install of my Mac Mini as a way to upgrade to Mavericks.  I've had the Mini since 2009 and the disc has some cruft so I thought it would be best to start with a clean slate.  That means reinstalling EVERYTHING including all the stuff I use for Node.js development. Hence, the idea came to mind that this would be a useful starting point for a series of blog posts.  I've always wondered what it would take to set up the Node.js equivalent to the MAMP application.

A brief look at Sequelize, an ORM for Node.js with MySQL, PostgreSQL or SQLITE3

(Mon Mar 25 2013 00:00:00 GMT+0200 (Eastern European Standard Time)) Want to do some database code but not think too much about it?  Such as, avoid SQL?  You can have your SQL and a simplified model of your database thanks to a module I just found for Node.js called Sequelize.  It adds an ORM-like layer on top of MySQL, PostgreSQL or SQLITE3, allowing you to do database interactions using JavaScript code rather than SQL.  It's fairly nice and easy to use, however I think it's likely there are some limitations to the complexity of what you can do with Sequelize.

Uploading/mirroring files to remote server in Node.js without using rsync

(Tue Feb 12 2013 00:00:00 GMT+0200 (Eastern European Standard Time)) How do you upload files to a server to deploy application or website code?  FTP?  rsync?  While it's easy enough to call a command line tool like rsync from a Node.js script, what if you're using a Windows computer that doesn't have those command line tools.  When I use Windows it's like stepping back into the dark ages where directory listings looked like we were making fire by rubbing sticks together.  Okay, there does appear to be an rsync for Windows but I had no confidence in it.  Also, I did not want to have a dependency on something like Cygwin.

Node v0.8.17 released - fixes security vulnerability - we're urged to upgrade ASAP

(Wed Jan 09 2013 00:00:00 GMT+0200 (Eastern European Standard Time)) Isaac Schlueter just posted this warning .. 

Implementing rsync or sftp in Node.js to synchronize files?

(Tue Jan 01 2013 00:00:00 GMT+0200 (Eastern European Standard Time)) How do you accomplish synchronizing a directory tree of files to a server?  For example (akashacms.com) AkashaCMS, my newly developed tool for building static websites, it builds a directory structure containing all the files for the website.  The question I've been pondering for awhile is, what's the best way to get those files over to the web server?  I've been using scp -r, and have also played with using rsync, and just integrated rsync into the AkashaCMS scripts.  But, I'm not seeing a great solution-set available, especially because this needs to run on my girlfriend's computer, and she is a Windows user and therefore does not have rsync available, I need a solution.

What's the best open source license for Node.js modules ??

(Wed Dec 19 2012 00:00:00 GMT+0200 (Eastern European Standard Time)) I've been developing a new software project with Node.js, a (akashacms.com) "content management" system that produces static HTML websites named AkashaCMS.  Last week I made my initial release into npm and knew I needed to put an open source license on the code, and by default I put in the GPL license.  But then I thought to ponder, is the GPL the best choice of license?  Will that license prevent others from using AkashaCMS?  In general, what's the best license for a Node.js open source project?  Does use of a Node module invoke the viral nature of the GPL and infect GPLness into modules that use the GPL'd module?  I didn't think about this myself, but would the GPL license interfere with others who want to contribute patches?  So I sent a query to the Node.js group on Google Groups (linked below), which touched off an insightful conversation.

Potential for integrating Node.js with Drupal and speed up Drupal page processing

(Fri Feb 17 2012 00:00:00 GMT+0200 (Eastern European Standard Time)) Besides some experience with Node.js, enough to write the book linked in the side bar, I've also spent a lot of time building and configuring Drupal websites.  I've been pondering the possibilities for marrying Node with Drupal and have also seen a few projects spring up with that purpose.  However the core issue is that Drupal page processing is not an asynchronous process like Node's query handling, instead Drupal implements the typical synchronous start at the beginning and go to the end step by step model.  You know, the model we're trying to get away from by adopting Node.