Deep Dive in Child Processes, Spawn, Exec, ExecFile, Fork, IPC What exactly Child Processes are then? When you run the NodeJS application it’ll have its own process just like any other application you run, may it be VS Code, VLC Player etc. The properties of this process is available on Global object’s process variable that we can… Continue reading Child Processes: Multitasking in NodeJS
Category: JavaScript
Worker Threads : Multitasking in NodeJS
Deep Dive into Worker threads Why do we need worker threads at all? A server can quickly become overwhelmed by a CPU-intensive workload. To illustrate, imagine you have two endpoints: one performs a simple, non-CPU intensive task, while the other handles a complex CPU-intensive operation that takes 10 seconds to complete. If your server is… Continue reading Worker Threads : Multitasking in NodeJS
Intro to multithreaded JavaScript
Escape the single-threaded event loop in browsers and on the server. Here’s how to use worker threads and web workers for modern multithreading in JavaScript. The JavaScript language is one of the wonders of the software world. It is incredibly powerful, flexible, and versatile. One limitation of its fundamental design, however, is its single-threaded nature. Traditional JavaScript appears to handle… Continue reading Intro to multithreaded JavaScript
Understanding Immutability in JavaScript
If you haven’t worked with immutability in JavaScript before, you might find it easy to confuse it with assigning a variable to a new value, or reassignment. While it’s possible to reassign variables and values declared using let or var, you’ll begin to run into issues when you try that with const. Say we assign… Continue reading Understanding Immutability in JavaScript
JavaScript Libraries for AI Engineering
Traditionally known for its role in web development, JavaScript has — much to the surprise of many — also proven invaluable in developing applications that use large language models (LLMs). In this article, we’ll explore five leading tools for AI engineering, highlighting some essential resources for developers wanting to incorporate LLMs into their projects. We’ve chosen them… Continue reading JavaScript Libraries for AI Engineering
Function Composition in JavaScript
Function composition is the pointwise application of one function to the result of another. Developers do it in a manual manner every day when they nest functions: compose = (fn1, fn2) => value => fn2(fn1(value)) But this is hard to read. There is a better way using function composition. Instead of reading them from inside… Continue reading Function Composition in JavaScript
Check whether the Time is in HH:MM AM/PM format
Scenario: You have to find if the time string is in hh:mm am/pm format. This code will work even if the hour has only one digit. Function: function isValidTimeFormat(timeStr) { const regex = /^([1-9]|1[0-2]):([0-5][0-9])s([APap][Mm])$/; return regex.test(timeStr); } Result: function will return true for both 5:00 am and 05:00 am values and will return false if… Continue reading Check whether the Time is in HH:MM AM/PM format
Determining the Last Day of the Month in JavaScript
Understanding the Logic To determine if a given day is the last day of the month, we can leverage the JavaScript Date object. The key idea is to create a new Date object representing the first day of the following month and then subtract one day. This resulting date will be the last day of… Continue reading Determining the Last Day of the Month in JavaScript
Upcoming Changes to External Suitelet URLs in 2024.2
Suitelets that are available without login have updated External URLs as of May 9, 2024. The new URL is displayed in the External URL field on the script deployment record for Suitelets that are available without login. The old URL will stop working as of NetSuite 2024.2. Give special consideration to the following: All hardcoded… Continue reading Upcoming Changes to External Suitelet URLs in 2024.2
Sum up the values of two objects with key-value pairs
To sum up the values of two objects with key-value pairs, you can iterate through the keys of both objects, add the corresponding values, and store the results in a new object. Here’s a simple JavaScript example to illustrate this: const obj1 = { a: 10, b: 20, c: 30 }; const obj2 = {… Continue reading Sum up the values of two objects with key-value pairs