Getting started with Node.js by parsing an excel file and learning about NPM and XLSX in the process.

Photo by Lukas Blazek on Unsplash

What is Node.js?

When we think JavaScript, we think browser, websites, web pages, interactivity, event listeners, onclick, etc. These are all related to the browser.

In fact, the browser used to be the only runtime environment for JavaScript. So whenever we wrote javascript we would only really see it in action once we open a web page on the browser.

This limited JavaScript from being used outside of the browser. But now, we can run JavaScript code almost anywhere…how? By installing the one they call, node. Node is a new environment for JavaScript.

Now there are two ways to run JavaScript:

  1. On a…

What are APIs? What makes REST APIs unique?

Photo by ThisIsEngineering from Pexels

What is an API and why might we need one?

An API (Application Programming Interface) is a solution for two applications to talk to each other. Usually, one application wants to leverage something (such as data) from the other application.

Without an API, these applications are not able to talk to each other because of many obstacles. For example, the apps were written in different programming languages or they didn’t have access to each other’s databases for security reasons.

If an application has an API around it, this allows other applications to interact with it using requests. Most of the time these are HTTP requests.

Let’s say, for example, our…

Continuous Integration, Continuous Delivery / Deployment, DevOps & pipeline

Meet the old school software team :-(

They seem to prefer to take things slow, they have different teams dedicated to different things. Developers only code, an IT / Operations team handles the rest, and they pass things to each other manually with a set of instructions.

The team works in iterations ranging anywhere from weeks to months. Within each iteration, the team develops, compiles, and packages their code. Afterwards, when the code is deployed and integrated, it gets tested by QA. …

Alas! sailors, we are going to set sail on this journey to dockerize our nodejs app!

Real Life Scenario

You have just finished coding your web app on your local machine, let’s say a MacBook Pro, with these dependencies:

  • node v12
  • express
  • nosql database on the cloud
  • API keys

OK, great but now you want to run this application on your best friend's computer because it’s a group project (we all love those).

She tries to download everything and run it on her Windows machine (eww windows) but there are just so many errors. She screams:

Common string functions you can use, and coding challenges involving string manipulation in JavaScript

Sometimes you want just a single character. Yep, you like to keep things simple. To get a single character from a string at a specified index:


function getInitials (firstName, lastName) {  return firstName.charAt(0) + lastName.charAt(0);}// Example: getInitials('Charles', 'Boyle') should return 'CB'.

Join strings with more strings.

  • `${stringOne} ${stringTwo}
  • concat(‘seperator’);
const first_name = ‘Joe’;const last_name = ‘Booboo’;const fullName = first_name.concat(‘ ‘, last_name);const fullNameV2 = first_name + “ “ + last_name;  // nobody likes this way anymore, people will judge youconst fullNameV3 = `${first_name} ${last_name}`; // the new cool way

For all you sensitive people…

Oh god, the documentation is crazy. Let me save you some time!

Let me tell you, the Firebase documentation is something special. It appears to be so simple and straightforward but actually, you need to hunt down the ends of the earth for those tiny things to make it work. But here we go. Let’s do this! :-)

Step 1: Create a Google Cloud application

Psst don’t worry about billing. It will all be FREE under the Spark plan.

for selectors, event listeners and creating HTML elements

1. Set up your DOM Selectors

Classic Selectors

document.getElementById(“login_form”); // Returns one itemdocument.getElementsByClassName("button-primary");  // Returns an HTML collection of items that satisfy the class namedocument.getElementsByTagName("h1"); // Returns an HTML collection of items that satisfy the tag name
  • return elements as a live collection of typeHTMLCollection of found elements, references not copies
  • HTMLCollections are not as array-like as NodeLists and do not support .forEach()

Query Selectors

  • querySelector has more options to select elements, you may pass it any CSS3 selector, not just simple ones for id, tag, or class
  • performance is O(n) and is worse…

We must pay our respects to higher-order functions and higher-order components in this article.

We all know when I say Higher-order something royal is coming. Is it just me?

Be prepared, they aren’t just like any ordinary functions. They are HIGHER ORDER functions.

What makes them so special you say? Well, they don’t accept strings or arrays like normal functions do. LAME that’s weaksauce. Higher-order functions accept FUNCTIONS as inputs.

Omg. Can you even do that? In JavaScript yes, you can do anything lol.

Functions in JavaScripts are just like objects, they are called First Class Citizens. Again more royalty…

What memorization is, and a simple example of it using a Hash. Super easy. Don’t worry. We will put this behind you.

Sometimes, a function can become expensive to call multiple times. It be like that.

What does that mean? It means if we call a function multiple times when we already have its result from a previous run, we shouldn’t need to process the resulting value again.

But we can skip running it again if this function is pure. Like pure water. Kidding. A pure function always returns the same output given the same input. So if I give…

What the heck is this? The “this” keyword, so confusing. Discussing this, bind, call…etc as solutions.

Ahuh, welcome to this fun article! No pun intended.

Ok mini exercise. Create a JavaScript file, and console.log (this)

What do you get?

function test() {

Window {postMessage: ƒ, blur: ƒ, focus: ƒ, close: ƒ, parent: Window, …}

Depends where you run you can see that “this” is window, which is the global object of a browser, or global if you are running javascript outside the browser.

Why did we get the window? It is because the test() function, is not part…

Jumanah Al Asadi

I am just a web developer who loves writing, teaching and indie rock music :) My teaching style is playful and fun. At least I hope, lol.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store