2coffee.dev

  • Using Clinic.js to Optimize Performance for Node.js Applications
    • node.js
    • performance
    • tools

    Using Clinic.js to Optimize Performance for Node.js Applications

    Since I started programming, I have been obsessed with the performance issues of the programs I write. I often wonder if what I wrote is good enough, if it's optimized, or how many users it can handle at the same time... That was the first step that laid the foundation for a deeper understanding of how programming languages work in general, and Node.js in particular. Over the years, participating in many projects, I realized that optimizing performance is not always easy...

    2 weeks ago

  • process.nextTick, setImmediate, and setTimeout
    • javascript
    • node.js

    process.nextTick, setImmediate, and setTimeout

    Anyone who delves deeper into Node.js may have seen articles distinguishing between setTimeout, setImmediate, and process.nextTick. I am no exception! At first, I tried to understand how to use them by reading articles and even Node documentation. However, they were mostly theoretical...

    2 months ago

  • Premium
    Hello

    Me & the desire to "play with words"

    Have you tried writing? And then failed or not satisfied? At 2coffee.dev we have had a hard time with writing. Don't be discouraged, because now we have a way to help you. Click to become a member now!

    Have you tried writing? And then failed or not satisfied? At 2coffee.dev we have had a hard time with writing. Don't be discouraged, because now we have a way to help you. Click to become a member now!

    View all
  • A Few Useful Functions in Node.js Util Module
    • node.js
    • javascript

    A Few Useful Functions in Node.js Util Module

    Node.js encompasses a range of components that come together to form a JavaScript runtime environment. In our series on Node.js Architecture - Introduction to Node.js, we explored the various components that make up Node.js and their respective functions. One of the built-in modules in Node.js is `util`, which, in my opinion, deserves more attention. The `util` module comprises a collection of small utility functions that can be helpful in certain situations. In this article, we will delve into some of these functions...

    4 months ago

  • Using pm2 to Manage Node.js Applications
    • node.js
    • pm2

    Using pm2 to Manage Node.js Applications

    When I first encountered Node.js and also learned how to use Linux, nodemon was a library that I often used to develop applications, as it would automatically "reload" the new code upon saving without needing to manually "kill" and restart the application, a feature now commonly referred to as "hot reload." After development comes deployment. While practicing running the application on the server, I struggled to figure out how to run it. If...

    5 months ago

  • Promise: How to Use and Some Notes!
    • promise
    • javascript
    • node.js

    Promise: How to Use and Some Notes!

    It would be a glaring omission not to talk about Promise in JavaScript. In fact, there have been many articles written about Promise, which you can find through Google or occasionally come across in a programming-related community. But because Promise is an important concept and everyone has a different way of explaining it, I still decided to write this article. When I first learned JavaScript, Promise was the most confusing thing. I thought I understood it and knew how to use it, but in reality, there were still many long and painful stumbles...

    1 year ago

  • How to Use and Tips for nvm - Node Version Manager
    • nvm
    • node.js

    How to Use and Tips for nvm - Node Version Manager

    What makes you feel "fear" when working with Node.js? For me, it's maintaining an old Node.js/JavaScript codebase, meaning a project that was written a long time ago and is using a very outdated version of Node that can barely run. It's not hard to understand, and I'm sure many readers have similar feelings. There are plenty of reasons for this, such as outdated syntax, disorganized code, libraries no longer supported, or even the lack of documentation... Imagine a library you've never used before suddenly has no trace of documentation – how would you proceed? Not to mention, when you encounter issues with an "archived" library, there's no one left to ask.

    1 year ago

  • From Callbacks, Promise to Async/Await in JavaScript/Node.js Asynchronous Processing
    • javascript
    • node.js

    From Callbacks, Promise to Async/Await in JavaScript/Node.js Asynchronous Processing

    JavaScript made its first appearance nearly 30 years ago as a new programming language of its time. It certainly needed some time to stabilize and gain widespread use. Until now, we can't deny the success of JavaScript, as it appears everywhere in the web world. Furthermore, it has expanded beyond web browsers to accomplish even more. A product of technology never stops evolving. Over the years, JavaScript has continuously evolved, introducing more useful features and addressing its inherent limitations. TC39 is a group established within the ECMA association with the goal of standardizing JavaScript while actively developing and expanding it.

    1 year ago

  • What is Corepack and its functionality in Node.js
    • node.js

    What is Corepack and its functionality in Node.js

    npm has been the default package manager bundled with Node.js for a long time. Most of us use npm to download packages from the npm registry, or whenever we need to reinstall all the dependencies used in a project. npm has high security mechanisms such as access to private packages, two-factor authentication and verification... Convenient as it is, npm also has some limitations such as slow package installation speed...

    1 year ago

  • Compilation of articles about Node.js
    • node.js

    Compilation of articles about Node.js

    Three (3) years of writing is neither short nor long, and during that time I have written many articles revolving around the topic of Node.js, from the basics to the details of how Node.js works, as well as sharing experiences to use it better. Today, I suddenly thought that if there are many articles like this scattered without being compiled into one page, it would make it difficult for readers to have an overview or find what they need. Therefore, in this article, I will compile a list of articles by category for readers to easily observe, and hopefully this will be a useful source of information for many people...

    1 year ago

  • What is Asynchronous Programming? Why is JavaScript a language for asynchronous programming?
    • javascript
    • other

    What is Asynchronous Programming? Why is JavaScript a language for asynchronous programming?

    JavaScript is a language for asynchronous programming - that's something everyone knows. Asynchronous operations are most evident in asynchronous functions, which do not immediately return a result but instead return it at some point in time. If you come from a background of PHP, Go, or even Java... you may have not heard or be confused about what asynchronous programming is. You may also wonder why JavaScript is a language for asynchronous programming and whether it brings any benefits or limitations to the language...

    1 year ago