NodeJS

All things related to backend JavaScript. Learn frameworks or take our word for selecting the right NPM packages.
NodeJS
06 May 2019

Fixing your NPM Installation

Fixing an npm installation gone wrong when 'sudo' is misused.
Fixing your NPM Installation

There's a bit of a headache going around in respect to global npm permissions. For those of us working on Unix-based systems, it's not uncommon to come across error messages complaining about your user permissions whenever installing new npm packages, especially when installing them globally. If errors like the one below  look familiar, you're not alone:

npm WARN checkPermissions Missing write access to /Users/toddbirchard/.npm-packages/lib/node_modules
npm ERR! path /Users/toddbirchard/.npm-packages/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/Users/toddbirchard/
Continue Reading
GraphQL
09 Mar 2019

Building a Client For Your GraphQL API

Now that we have an understanding of GraphQL queries and API setup, it's time to get that data.
Building a Client For Your GraphQL API

If you had the pleasure of joining us last time, we had just completed a crash course in structuring GraphQL Queries. As much we all love studying abstract queries within the confines of a playground environment, the only real way to learn anything to overzealously attempt to build something way out of our skill level. Thus, we're going to shift gears and actually make something with all the dry technical knowledge we've accumulated so far. Hooray!

Data Gone Wild: Exposing Your GraphQL Endpoint

If you're following along with Prisma as your GraphQL service, the endpoint for your API defaults to

Continue Reading
NodeJS
20 Feb 2019

Making API Requests With node-fetch

Using the lightweight node-fetch library for REST API requests in NodeJS.
Making API Requests With node-fetch

If you're the type of person to read technical Javascript posts in your free time (you are), you don't need me to tell you that JQuery is dead. JQuery themselves have proclaimed JQuery to be dead. The only cool thing about JQuery is who can remove it from their legacy stack the fastest, which begs the question: why is the third most popular page on this site an old post about JQuery?

Maintaining a blog of tutorials has taught me a lot about the gap between perception and reality. While we content publishers sling Medium posts from our ivory towers,

Continue Reading
GraphQL
03 Feb 2019

Easily Build GraphQL APIs with Prisma

Jump on the GraphQL Bandwagon with a little help from Prisma.
Easily Build GraphQL APIs with Prisma

The technology sector is reeling after an official statement was released by the UN's International Council of Coolness last week. The statement clearly states what status-quo developers have feared for months: if you haven't shifted from REST to GraphQL by now, you are officially recognized by the international community to hold "uncool" status. A humanitarian crisis is already unfolding as refugees of coolness are threatening to overtake borders, sparking fears of an influx of Thinkpad Laptops, IntelliJ, and other Class A uncool narcotics.

Hold up: is GraphQL That Dramatic of an Improvement over REST?

In all honesty, I've found that

Continue Reading
JavaScript
06 Oct 2018

Compile Frontend JavaScript with Babel and Gulp

Using ECMAScript functions on the frontend the quick and dirty way.
Compile Frontend JavaScript with Babel and Gulp

NOTE: This post has not aged particularly well. This is made evident by the presence of the word "Gulp" present throughout the post.


As you may have already deduced from the occasional glaring holes in my programming knowledge, I haven’t spent as much of my life programming than, well, anybody who haphazardly threw away an 8-year product management career. Apparently, a lot can happen in 8 years... especially when it comes to JavaScript.
Putting aside that whole server-side  NodeJS thing or whatever it’s called, there’s years worth of mindfucks for those of us who fairly recently returned

Continue Reading
NodeJS
28 Jun 2018

Upgrading to Gulp 4.0.0

Upgrading to Gulp 4 and tackling the breaking changes that come with it.
Upgrading to Gulp 4.0.0

Back in the day we touched on some of the wonderful upsides of implementing Gulp into your workflow. If you have been following along and happened to install the latest version of Gulp, you may has noticed something horrible happen: nothing worked. I probably should’ve mentioned that the latest major update to Gulp, Gulp 4, is actually a breaking update. That's my bad.

Strangely, documentation around upgrading from Gulp 3.X to Gulp 4 seems to be lagging way behind this release, with the closest thing to official documentation being some article a guy posted on Medium a while

Continue Reading
NodeJS
26 Jun 2018

Building Page Templates in ExpressJS With Handlebars

Building views in NodeJS by incorporating layouts, partials, and everything in between.
Building Page Templates in ExpressJS With Handlebars

Writing HTML sucks, thus we should do everything to minimize the time we spend writing it as much as possible.  Thus, we have Handlebars: a lightweight templating system for Node. Handlebars allows us to avoid repetitive code by compiling the final DOM structure of our site via logic, typically compiled by task runners such as Grunt or Gulp.

If you're involved in any sort of Node development, you're probably already familiar with Handlebars to a degree. I thought I was, but it isn't until we need to start a new project from scratch that we realize that we totally forgot

Continue Reading
NodeJS
22 Jun 2018

Read and Write to S3 Buckets via NodeJS

Node’s most popular package interacting with the most popular file store on the world’s most popular cloud.
Read and Write to S3 Buckets via NodeJS

We here at H+S are dedicated to one simple cause: creating posts about oddly specific programming scenarios. Somewhere in the world as sad soul is looking to programmatically access files from an S3 server while keeping their bucket private. To that person: we heard you.

There are plenty of reasons you'd want to access files in S3. For example, let's say you read that post about using Pandas in a Lambda function. Since you're already familiar with PyMySQL, you may hypothetically be in a position to export data from a DB query to a CSV saved in S3. I

Continue Reading
NodeJS
30 May 2018

Using Gulp: Tasks to Make Frontend Tolerable

Optimize your frontend code with Gulp: the task runner to make you production-ready.
Using Gulp: Tasks to Make Frontend Tolerable

NOTE:  This tutorial was written for Gulp versions <4.0.0. Check out this post for Gulp >4.0.0


Perhaps the whole obligatory-Gulp-tutorial on [Some Coding Blog] thing has become a bit cliché at this point. Haters may do as they will, but I 'll take any opportunity to jam as many SEO keywords I can get at this point. You know the ones: Gulp, ExpressJS, NodeJS, or perhaps even React Vue frontend Ubuntu framework API social cloud data entrepreneur community.

Regardless, we all need our own copy+paste references from time-to-time, or even worse: when we

Continue Reading
ExpressJS
15 May 2018

Build Custom Widgets For Your Ghost Blog

Get started customizing your themes with simple widgets.
Build Custom Widgets For Your Ghost Blog

Here at H+S headquarters, we're pretty into the Ghost blogging platform. It's a lot like Wordpress, except without everything that sucks about Wordpress. It's a Node app, isn't bloated with widgets, is more secure, smarter, prettier, and so on. If you're a dev looking to get a quick clean CMS running, Ghost is pretty much a no-brainer.

While the platform has been around for a while, the community is still in its infancy as humanity lags behind the curve, with 80% of all sites victim of hacking being Wordpress-based. As such, we consider it our duty to share knowledge

Continue Reading
NodeJS
18 Nov 2017

Starting an ExpressJS App

Installation guide for ExpressJS with popular customization options.
Starting an ExpressJS App

Over the past few months I've found myself spinning up tons of new servers and walking through the process of pushing express apps live.

Because this process always comes at unexpected times, I've never bothered documenting the steps it takes to get a blank box running express. Surprisingly it seems as though few have bothered to walk through every step involved in a single place, and most express tutorials contain outdated information which likely leads to headaches for newcomers.

I'll be walking through an ExpressJS setup with the tech I always opt for.

Stack

  • NodeJS
  • NPM
  • Nginx
  • Express
  • Express-Generator
  • Sass
Continue Reading