We gonna explore in simple terms how Node.js actually works. All the stuff you need to know so you build efficient node apps.
To follow along, you need to have some basic understanding about asynchronous and backend programming.
In terms of Node’s dependencies, there’s basically a couple of libraries that Node depends on in order to work properly:
Libuv: an open source library with a strong focus on asynchronous Input/Output, this layer is what gives node access to many functionalities such as file system, networking and more. Besides that, Libuv implements two extremely important features of Node.js which are Event Loop & Thread Pool and we’ll talk about these bad guys soon. …
We’re gonna talk about why we can’t assume that a function is asynchronous even if it takes a callback.
Maybe you’re answer is “when argument of a function is a function”. Basically yes, but not exactly, every asynchronous function takes a function argument, but not every function that does so is asynchronous because argument function can be called synchronously.
Simply taking a callback doesn’t make a function asynchronous. There are many examples of functions that take a function argument but are not asynchronous. For example there’s
forEach in Array. …
I am gonna show you what I did to prevent videos link sharing, so they’re only available for subscribed users.
I was working on an e-learning website where users obviously gonna watch videos, but the problem was, how to prevent subscribed users from sharing a video source with other unsubscribed users?
To secure getting the video source from the database is easy, you can use middlewares or anything that controls access. But after getting the link, it’s hard to prevent the user from copying the link from the source of the web page and share it.
“A user is guilty until proven…
Before we jump in, I totally recommend reading my previous article first which gives an introduction about async JS for you to get your feet wet. In the other hand, I don’t recommend that you continue if you are new to JS.
Iknow, you’ve been hearing about Promises so much, tutorials always mention it. But the good thing is that now you had the courage to discover it. Congrats, you’re on the right path!👌
let btn = document.addEventListener('click', …
This means it executes code in order and must finish executing a piece of code before moving onto the next one. It’s synchronous, but at times that can be harmful. …
You should have some familiarity with HTML/CSS. You do not need prior programming experience.
// Here goes your JS code
You can place any number of scripts in an HTML document. Scripts can be placed in the
<body>, or in the
<head> section of an HTML page, or in both.
I am glad you asked because there is a difference, and it’s quite important. …
An introduction to the King of the web, the most important language for a web developer to learn!
Speed up CSS coding, increase your workflow and make it more organized using the preprocessor Sass!
In the previous episodes, we learned CSS basics and some advanced styling techniques and I think it’s time to get the most out of CSS and learn about its preprocessors.
Ok, now you may be wondering what the heck is that?
To keep it simple, CSS preprocessors will add some features that don’t exist in pure CSS, such as mixin, nesting selector, inheritance selector, and so on. What are all these? …
We’re going to learn three CSS concepts you’ll probably need in your projects.
This is the the fourth episode in this series, if you didn’t read the previous episode “CSS of Things”, which I highly recommend because it gives an overview of CSS, feel free to do so by visiting this link. If you want the full plan for this series, you can find it here.
In the previous article, we styled a CV (Curriculum Vitae) web page with basic CSS properties. We made it a little bit pretty but as I said we can do much better! …
Learn CSS basics using a real world example!
Welcome to a new episode of this series ! In the last one, I gave an overview of web development and a short HTML course. So if you didn’t read those yet, feel free to do so, you’ll find here the full plan for this series. But even if you just need an introduction to CSS, you still are in the right place. Let’s start !
To keep it short, CSS stands for Cascading Style Sheets, it describes how HTML elements are to be displayed.
Front-end developers abstraction for CSS is simply: