Best Practices for publishing to NPM

So, you are thinking of publishing a package on the npm registry? Here are some best practices that may not be so obvious at a glance but I’ve learned with experience. Include only the files you need You can add the following inside your package.json { "files": [ "dist" ] } This is assuming you are using TypeScript and have a dist/ folder, this can be your src/ folder if you are using plain JavaScript....

September 2, 2026 · 4 min

Understanding Javascript Promises

JavaScript’s promises and async/await might seem complicated at a glance and there are a lot of pitfalls beginners fall for, in this post I will try to explain everything you need to get started. Callbacks First we have to take a step back and realize what promises are trying to replace. Callbacks. In JavaScript some functions can be asynchronous, meaning it might take some time before it has results to give you, and while JavaScript is single-threaded, certain I/O functions can run asynchronously in the host environment (such as the browser or Node....

April 23, 2026 · 11 min