I use Macs, and I have a lot of Node projects on my Macs. Those projects don’t all use the same version of Node, so I need to have multiple versions installed. I also want to have a “system” version of Node installed. I’m really happy with how I have my Macs set up to… Continue reading Node Setup for Macs
Tag: node.js
The Problem with Promises and Domains
What are domains? How restify uses domains People have been having problems using Promises with restify And people have been having problems with Promises and domains in node for a long time Maybe it will be resolved in node v8.x In the meantime, one “solution” (a/k/a work-around, a/k/a hack) is to swap out the native Promise… Continue reading The Problem with Promises and Domains
So You Want To Keep Your Cookies Secure
At Social Tables, we have this Koa app that needs to read and set a session cookie. We don’t want to send that cookie over an unencrypted connection, though. We use koa-generic-session for session management. That library uses the cookies library under-the-hood, and luckily, there’s a simple configuration option to avoid sending cookies over an… Continue reading So You Want To Keep Your Cookies Secure
Link Dump – Node.js Security
A Malicious Module on npm The npm Meltdown Uncovers Serious Security Risks Package install scripts vulnerability Is Guy Fieri in Your Node.js Packages? Controlling the Node.js security risk of npm dependencies One easy way to inject malicious code in any Node.js application
Making the Correct Insanely Difficult
tl;dr If you’re trying to configure nginx on Elastic Beanstalk to redirect http requests to https, here’s what I learned. During deployment, the nginx configuration for your app is located at this file path: /tmp/deployment/config/#etc#nginx#conf.d#00_elastic_beanstalk_proxy.conf via Using a container command, you can edit that nginx configuration file right before it gets deployed. I used a… Continue reading Making the Correct Insanely Difficult
npm CLI Quick-Start for Organizations
We have a number of private npm packages, and I needed to create a new user, grant that user read-only access to our private packages. The npm docs are great. Really great. Go there for details. But here are the key commands for this (probably common) series of steps. Create a new team $ npm… Continue reading npm CLI Quick-Start for Organizations
Yosemite Upgrade Changes Open File Limit
OSX has a ridiculously low limit on the maximum number of open files. If you use OSX to develop Node applications — or even if you just use Node tools like grunt or gulp — you’ve no doubt run into this issue. To address this, I have this line in my $HOME/.bash_profile: ulimit -n 1000000… Continue reading Yosemite Upgrade Changes Open File Limit
Could JXCore Be An Awesome Deployment Tool?
JXCore allows you to turn Node.JS applications into stand-alone executables. One possible use case would be to package up your entire application in an executable and deploy it to production servers, skipping the usual dance with git and npm. If performance is good, this could make for an interesting deployment tool. Deploy by Dropbox? Yup,… Continue reading Could JXCore Be An Awesome Deployment Tool?
Fixing Node.js v0.8.2 Build on Linux
There’s a nasty gcc bug on RedHat (RHEL 6) and CentOS Linux (and related) that gets triggered when you try to build Node.js v0.8.2: pure virtual method called. Solution: Run make install CFLAGS+=-O2 CXXFLAGS+=-O2 instead of just make install. More info: Cannot compile node.js 0.8.2 under CentOS 6.2 “make install”: terminate called without an active… Continue reading Fixing Node.js v0.8.2 Build on Linux
Mongoose Indexes and RAM Usage
If you’re using Mongoose, you’ve changed your indexes, and you’re wondering why you’ve run out of RAM, go into the Mongo shell and manually drop any indexes you are no longer using. Mongoose has no method for deleting indexes you’re not using any more, so they accumulate, gobbling up RAM. Now that you’ve cleaned out… Continue reading Mongoose Indexes and RAM Usage