hello.js

var please = require('share');
console.log('thank you');

Wednesday, 13 February, 2019 UTC

Node.js TypeScript #1. Modules, process arguments, basics of the File System

Node.js TypeScript #1. Modules, process arguments, basics of the File System

In this series, we go through the core concepts of Node.js. In general, in this series, we focus on the environment of Node.js and not the JavaScript itself, while having the advantages of static typing using TypeScript. It includes matters like the ... more


Monday, 4 February, 2019 UTC

TypeScript Express tutorial #10. Testing Express applications

TypeScript Express tutorial #10. Testing Express applications

An essential part of developing a fully functional software is testing . In this article, we focus on making our application more testable and implementing unit and integration tests using Jest and a library called SuperTest. This part of the TypeScript ... more


Monday, 28 January, 2019 UTC

TypeScript Express tutorial #9. The basics of migrations using TypeORM and Postgres

TypeScript Express tutorial #9. The basics of migrations using TypeORM and Postgres

In this article, we go through migrations, which is a significant thing when working with Postgres . We learn what they are and the basics of how to write them. Although the knowledge of SQL is useful here, we also learn how to have them auto-generated ... more


Monday, 21 January, 2019 UTC

TypeScript Express tutorial #8. Types of relationships with Postgres and TypeORM

TypeScript Express tutorial #8. Types of relationships with Postgres and TypeORM

Today we continue using Postgres with Express and Typescript. Since Postgres is a relational database, relationships are an essential part of working with it, and we cover it today. To handle it we use TypeORM. The code for the tutorial is in the express-typescript ... more


Tuesday, 15 January, 2019 UTC

TypeScript Express tutorial #7. Relational databases with Postgres and TypeORM

TypeScript Express tutorial #7. Relational databases with Postgres and TypeORM

Today our tutorial takes a bit of a turn as we look into relational databases, Postgres in particular. In this article, we go through setting up an environment with Express Postgres . We also set up the pgAdmin platform so that we get an overview of ... more


Monday, 7 January, 2019 UTC

TypeScript Express tutorial #6. Basic data processing with MongoDB aggregation

TypeScript Express tutorial #6. Basic data processing with MongoDB aggregation

With MongoDB aggregation, we can process data and get computed results. Thanks to that, we get additional information about the documents in our collections. You can use it to perform some tasks on the data and let the MongoDB handle it for you. In this ... more


Monday, 31 December, 2018 UTC

TypeScript Express tutorial #5. MongoDB relationships between documents

TypeScript Express tutorial #5. MongoDB relationships between documents

Today we dive into MongoDB relationships between documents. To do it we use Mongoose and the populate feature. As always, the code that we cover here is available in the express-typescript repository. You’re welcome to give it a star. MongoDB relationships ... more


Monday, 24 December, 2018 UTC

TypeScript Express tutorial #4. Registering users and authenticating with JWT

TypeScript Express tutorial #4. Registering users and authenticating with JWT

Today we cover an essential part of almost every application: registering users and authenticating them. To implement it, we use JSON Web Tokens (JWT). Instead of getting help from libraries like Passport, we build everything from the ground up to get ... more


Tuesday, 18 December, 2018 UTC

TypeScript Express tutorial #3. Error handling and validating incoming data

TypeScript Express tutorial #3. Error handling and validating incoming data

Since not always everything goes perfectly, you need to expect the unexpected. To prepare for that, we cover TypeScript Express error handling and incoming data validation. Just as before, the repository for the tutorial is mwanago/express-typescript. ... more


Tuesday, 11 December, 2018 UTC

TypeScript Express tutorial #2. MongoDB, models and environment variables

TypeScript Express tutorial #2. MongoDB, models and environment variables

In this part of the Express TypeScript tutorial, we cover using a MongoDB database. To do that properly, we also learn the concept of environment variables . Since we follow the MVC pattern, we introduce the idea of a model . Just as in the previous ... more


Tuesday, 4 December, 2018 UTC

TypeScript Express tutorial #1. Middleware, routing, and controllers

TypeScript Express tutorial #1. Middleware, routing, and controllers

Hello! In this new series, we build a RESTful application with TypeScript Express . The course is going to cover the fundamental concepts of the express framework and tools like MongoDB . Some basic knowledge of TypeScript would be useful, as we focus ... more


Monday, 26 November, 2018 UTC

Using recursion to traverse data structures. Execution context and the call stack

Using recursion to traverse data structures. Execution context and the call stack

Hello! Today we tackle a very interesting topic, which is recursion. The article describes its main principles and dives deeper to uncover how does it work under the hood of the language, covering execution context and the call stack. Let’s go! JavaScript ... more


Monday, 19 November, 2018 UTC

Is eval evil? Just In Time (JIT) compiling

Is eval evil? Just In Time (JIT) compiling

There is a high chance that you’ve stumbled across the JavaScript eval function. It is a common knowledge that in JavaScript, eval is something that is a bad practice. Have you ever wondered how it works and why exactly a lot of people discourage it? ... more


Wednesday, 14 November, 2018 UTC

Handling errors in JavaScript with try…catch and finally

Handling errors in JavaScript with try…catch and finally

Mistakes happen. That’s a given. According to Murphy’s law, whatever can go wrong, will go wrong. Your job, as a programmer, is to be prepared for that fact. You have a set of tools that are prepared to do precisely that. In this article, we go through ... more


Monday, 5 November, 2018 UTC

Cross-Origin Resource Sharing. Avoiding Access-Control-Allow-Origin CORS error

Cross-Origin Resource Sharing. Avoiding Access-Control-Allow-Origin CORS error

In this article, we explain what Cross-Origin Resource Sharing ( CORS ) is and how to avoid errors associated with it and the Access-Control-Allow-Origin header. This includes describing it both from the viewpoint of the frontend and the backend. CORS: ... more


Monday, 29 October, 2018 UTC

Comparing working with JSON using the XHR and the Fetch API

Comparing working with JSON using the XHR and the Fetch API

Nowadays, JavaScript is often used to make Ajax requests. There are a lot of libraries that can do that for us, for example, axios or jQuery . Both of them use XMLHttpRequest ( XHR ). It differs from the relatively new Fetch API that was introduced a ... more


Tuesday, 23 October, 2018 UTC

Concatenating strings with template literals. Tagged templates

Concatenating strings with template literals. Tagged templates

In this article, we cover ways to join strings. Even though it includes old methods of concatenating strings, we focus on template literals. Here you can learn how they work and how to expand their functionality with tags. Let’s go! Before template literals ... more


Monday, 15 October, 2018 UTC

Explaining the JavaScript array. Sparse and dense arrays.

Explaining the JavaScript array. Sparse and dense arrays.

The array is a popular concept across many programming languages. At first glance, arrays work in the same way, but the JavaScript array differs from languages like C++. The article explains the basics of how JavaScript arrays work under the hood. It ... more


Monday, 8 October, 2018 UTC

Fundamentals of storing data in the browser with IndexedDB

Fundamentals of storing data in the browser with IndexedDB

IndexedDB is another API meant for client-side storage. It is good for storing a significant amount of data, including files. IndexedDB is more suitable than WebStorage suitable for keeping structured data, and definitely more adequate for that than ... more


Tuesday, 2 October, 2018 UTC

Object property descriptors. Getters and setters

Object property descriptors. Getters and setters

With the properties of objects, you can set more than just their values. In this article, you can learn what is the property descriptor and what you can achieve with it. Among other things, you can use getters and setters and the article also explains ... more


Wednesday, 26 September, 2018 UTC

Introduction to WebSockets. Creating a Node.js server and using WebSocket API in the browser

Introduction to WebSockets. Creating a Node.js server and using WebSocket API in the browser

WebSocket is a protocol that makes two-way communication in real-time between the user and the server possible. A common use cases are chats and online multiplayer games. Today we cover implementing it both on frontend and backend. Let’s go! Explaining ... more


Monday, 17 September, 2018 UTC

JavaScript testing tutorial – part four. Mocking API calls and simulating React components interactions

JavaScript testing tutorial – part four. Mocking API calls and simulating React components interactions

Today we test our React components further. It involves simulating component interactions and mocking the API calls. You will learn how to do both, so let’s go! Mocking A common thing is for our application to fetch some data from the API. A problem ... more


Monday, 10 September, 2018 UTC

JavaScript testing tutorial – part three. Testing props, the mount function and snapshot tests.

JavaScript testing tutorial – part three. Testing props, the mount function and snapshot tests.

Hello! In the previous part of the tutorial, we’ve covered the very basics of testing React components with Enzyme. Today we will dig a bit deeper and learn how to test props, how (and why) use the mount function and what are the snapshot tests. Let’s ... more


Monday, 3 September, 2018 UTC

JavaScript testing tutorial – part two. Introducing Enzyme and testing React components

JavaScript testing tutorial – part two. Introducing Enzyme and testing React components

At the previous part of the tutorial, we’ve briefly covered the basics of unit testing. This time we will go further and start testing React with the Enzyme library. Thanks to the that, your application will be more reliable and it will be easier to ... more


Monday, 27 August, 2018 UTC

JavaScript testing tutorial – part one. Explaining types of tests. Basics of unit testing with Jest

JavaScript testing tutorial – part one. Explaining types of tests. Basics of unit testing with Jest

Hello! Today we start another big series, which is about JavaScript testing. There are various different types of tests and we will start by explaining some of them. In the beginning, we will cover the basics of unit testing , which is testing individual ... more


Monday, 20 August, 2018 UTC

Webpack 4 course – part eight. Dynamic imports with prefetch and preload

Webpack 4 course – part eight. Dynamic imports with prefetch and preload

In the first article of this Webpack 4 course series, we’ve covered imports and exports. This time we will dig deeper into dynamic imports because they deserve a separate article. We will explain what they are and how to use them. Let’s start! Webpack ... more


Monday, 13 August, 2018 UTC

Webpack 4 course – part seven. Decreasing the bundle size with tree shaking

Webpack 4 course – part seven. Decreasing the bundle size with tree shaking

In this part of our webpack 4 course, we will take the idea of optimization even further. We will learn what the tree shaking is and how to use it. You will find out what requirements you need to meet in order for the Webpack 4 tree shaking to work and ... more


Monday, 6 August, 2018 UTC

Webpack 4 course – part six. Increasing development experience

Webpack 4 course – part six. Increasing development experience

Today we will cover the development value of the mode property. It will automatically set the webpack configuration for you to make the development easier. Aside from that, we will also cover the wepback-dev-server and webpack-serve – Hot Module Replacement ... more


Monday, 30 July, 2018 UTC

Webpack 4 course – part five. Built-in optimization for production

Webpack 4 course – part five. Built-in optimization for production

In this part of the Webpack 4 course, we will focus on increasing the experience of users of your application by making our output smaller. This will mean handling the code in a different way in the production environment. Today we will explain the built-in ... more


Monday, 23 July, 2018 UTC

Webpack 4 course – part three. Working with plugins

Webpack 4 course – part three. Working with plugins

Hello! Today we introduce the concept of plugins. They differ from loaders in a way that they can perform a wider range of tasks. Basically, they do anything else, that loaders can’t do. While loaders are tied to a certain type of files, plugins can ... more