Why I Don't Use Promises and Async/Await Abstractions In Node

9 August 2019

In this article, I'll talk about callback hell again. But this time, I'll try to describe how I see this problem, and why I actually think that this is a problem. Also I'll explain why I think that abstractions such as Promise and async/await don't help us to structure our code in a better way. I'll demonstrate my solution that's based on ideas of declarative and pure object-oriented programming, which I'm big fan of. And I'll show you why I think that declarative constructions is the only good way to write asynchronous code for big and complex applications.

continue...

Simple JWT Implementation in Node.js: Asymmetric Variation

7 April 2019

In the previous article, I explained how you can implement authorization and authentication via JWT using symmetric algorithms such as HS256. Now, I'll try to explain asymmetric approach (RS256).

continue...

Simple JWT Implementation in Node.js: Symmetric Variation

6 April 2019

In this article, I'll explain how easily you can implement authorization and authentication via JWT using only standard modules in Node.js. So, it might be interesting to you, if you really want to know how it works.

continue...

How I Control Quality of npm Packages via Travis CI

6 March 2019

Let's say you want to create an open source JS library and publish it to npm and also release it to GitHub. You can do it manually, but it's not convinient and you'll not be able to control quality of your project. I've created a solution that can help to automatize the whole process and allows to catch problems in code before it's released. In this article, I'll share my variation of configuration that I use in Travis CI and try to explain in detail how it works. You might find it very useful, especially if you use restricted master branch in your repo.

continue...

Page: Pure Object-Oriented Web Framework For Node.js

1 October 2018

I am glad to introduce my web framework Page. It can be described as a base for any applications on top of it with server and client in Node.js. It provides a lot of features and common scenarios for using web. It's completely based on the Async Tree Pattern that allows you to customize Page in any way you want, you can even throw it away and build other base core for your application. In another words, Page is just an example of how you can build your application using libraries that are based on cutie. In this article, I will list conceptual points why you should thnk about moving to such framework as Page.

continue...

Declarative REST API

16 June 2018

We all are used to MVC for building REST applications. In this article, I'll show how you can build REST API using object-oriented approach. It'll be demonstrated on my library cutie-rest which was released recently.

continue...

As Conception In Async Tree

6 May 2018

If you don't know what async tree is, you definitely should take a look at this. So in short, it's a beautiful abstraction the main idea of which is to make our code declarative in asynchronous environment. So, assuming that you know (or just acquainted with) this conception, I want to describe how managing of cache could be implemented for this abstraction.

continue...

Convenient Test Executor for Node.js

6 May 2018

I was really surprised not finding a convenient test runner/executor in npm that can run test scripts in directory/directories recursively from the code. Also it would be nice to log how many tests are failed and passed, log stack traces of failed scripts, and log execution time. Moreover, I wanted to run scripts asynchronously. So, I decided that it's a great opportunity to create a such tool. I've called it test-executor, and it's iteresting that this name was available in npm. In this article I'll explain how this library works and how to use it.

continue...

Declarative Unit Testing

1 May 2018

It's amazing how easy and joyful unit testing can be if you write code in declarative style. I've just released my new library cutie-assert. It is a cutie extension for assert module in Node. In this article, I want to show you the real power of this library.

continue...

Declarative events

5 April 2018

There is another abstraction in Node that must be considered. And this is the events.

continue...

Async Objects instead of Async Calls

26 January 2018

No secret, OOP in JS is not perfect. At least it's not so mature as it's in Java, for example. And actually I don't see that anybody from the JavaScript world would use this paradigm as the main concept for their applications. In the modern software development the ideas of the object-oriented programming (as itself) are becoming less and less popular and giving way to the ideas of functional programming. But I think we should not give up such a powerful and wonderful tool/mechanism that can simplify our complex systems. In this article, I'll try to introduce the idea of async objects and show how they can help us to get rid of the main problem in asyncronious enviroment… Of course, I am talking about callbacks.

continue...

Drag&Drop and Drag&Resize in Pure JS style

20 December 2017

Although there are a lot of libraries doing such simple things like drag&drop and drag&resize, sometimes we need to do specific functional interfaces where it's important to understand how these things really work. If you are begginer in js or just curious programmer, this article would be very useful for you (you will learn some tricks in event driven js system and how it works in the whole).

continue...