Node


Testing Our Node Profanity Filter

In our previous post, we create a profanity filter in NodeJS but the one thing we did not do was add any automated tests. I am huge fan of automated testing so in this article we are going to use Jest to add some automated tests to our profanity filter.

Read More


Create A Profanity Filter in Node

I was recently working with a client on a Q&A submission form for student assemblies that they are running and the client needed to strip out any profanity from the question submission.

We decided that we want this in the API versus on the submission form itself so that the students couldn’t just open up the browser developer tools and figure out how to skirt around the filter. The API is written in NodeJS Express.

Read More


How to Download and Extract a Zip File with Node

Downloading and extracting a zip file using Node seemed like a pretty easy task but alas it took some time to figure out.

While researching how to do this, I didn’t find a library that had all of the requirements within it but I did find a few that allowed me to meet the requirements

Requirements

  1. Download zip file from a url
  2. Extract zip file to a directory location
  3. Extract a single directory and all of its sub-directories within the zip file

Downloading the Zip File

Step 1 was to get the zip file downloaded using Node and make sure that I could manually open it. To download the zip file, I am using the superagent package and piping the download to a file using fs.

Read More


Running Multiple Version of Node On Windows

I am sure that many of you are in the same situation that I am in with needing a different version of node for different projects and you don’t want to have to create a new virtual machine for each project just because of node. Luckily with nvm you can install multiple versions of Node on the same machine and switch between them with a simple command line call.

The one downside to having multiple versions of Node installed is that you have to install the global packages for each version of node that you want them available to. There is no ability to share packages between versions. This means that it will take a bit more disk space but most node packages are fairly small so this should be a none issue.

Read More


Visual Studio 2015 - External Web Tools

I ran into an issue with an npm package mis-behaving in Visual Studio 2015 but working just fine from the command line.

After scratching my head for awhile trying to figure out what was going on, I discovered that Visual Studio was pointing to its own version of npm and node and not that ones that were available in my path that the command line was using. Visual Studio 2015 ships with:

Read More


Npm, Bower, Git, and Bash Proxy Configurations

When you are using npm, bower, and git behind a proxy server you have to do a little bit of configuration. Luckily it is super easy to do these configurations. Almost all of the programs have command line commands to set and unset the proxy server.

Updates:

  • Updated 2015-Feb-01: Added running source command for Bash and Ruby Gems section
  • Updated 2015-May-07: Added the Ionic Start command
  • Updated 2015-May-08: Added the Android SDK
  • Updated 2015-Aug-03: Added command lines to set proxy
  • Updated 2015-Oct-20: Added Gradle

Windows Command Prompt

Current Command Prompt Only

set http_proxy=[Your Proxy]:[Proxy Port]
set https_proxy=[Your Proxy]:[Proxy Port]

Unset Current Session

set http_proxy=
set https_proxy=

Globally as a System Environment Variable

Run from an administrative command prompt

Read More