Bye bye Callbacks, hello Promises in NodeJS
Explains the evolution from callbacks to Promises and async/await in NodeJS for cleaner asynchronous code.
Puru Vijay is a full-stack web developer from India with 10+ years of experience, focused on building blazing-fast, highly performant web applications, with deep expertise in Svelte, modern testing, and frontend architecture.
40 articles from this blog
Explains the evolution from callbacks to Promises and async/await in NodeJS for cleaner asynchronous code.
A quick Node.js tutorial showing how to create a folder only if it doesn't exist, using just 3 lines of code with no external dependencies.
A tutorial on using async/await with Node.js fs.promises to read, process, and write files, replacing callback patterns for cleaner, sequential code.
Explains the benefits and usage of Top-Level Await in JavaScript, comparing it to older IIFE patterns and detailing browser/Node.js requirements.
A guide for students on how to apply for the GitHub Student Developer Pack to access free tools, GitHub Pro, and other valuable perks.
A guide to setting up Prettier for automatic code formatting in VSCode, covering both the extension and CLI.
A guide on cleaning up unwanted commits from previous pull requests to keep your git history clean when contributing to open source projects.
Explains why using async/await with Array.map() returns Promises and how to properly handle chained async operations with Promise.all or for loops.
A guide to simplifying asynchronous JavaScript code by creating a promisified version of setTimeout for cleaner, more readable sequences.
A developer explains how to split an array into chunks to parallelize tasks, using a JavaScript function to improve performance in web scraping.
A technical guide on automating GIF to MP4 conversion for web performance using Node.js and the FFmpeg library.
A developer explains the importance of image optimization for performance and cost, and details their journey to automate it using incremental builds.
A technical guide on building a blog using Markdown, frontmatter for metadata, and NPM packages like markdown-it for HTML conversion.
A developer explains the design philosophy and technical requirements behind their personal website, including the choice of StencilJS and Vercel.
Explains the security and performance risks of using target=_blank links without rel="noopener" and provides the simple fix.
A guide to efficiently loading Google Fonts using resource hints, respecting users' data plans by conditionally loading fonts based on Data Saver settings.
An introduction to Web Workers, explaining how they enable multithreading in JavaScript to prevent UI blocking, with basic usage examples.
A tutorial on detecting route change events in StencilJS using the built-in router without external dependencies.
Explains a critical issue with Stencil Helmet during prerendering and the simple fix of keeping a title tag in index.html.
A developer's first blog post, introducing their site built with StencilJS and plans to write about technical concepts and solutions.