If you want to create an npm package and ensure it can be used by everyone, you'll want it to support CommonJS (CJS) and ECMAScript Modules (ESM). Here's how to build such a package using TypeScript. CommonJS and ESM When building JavaScript apps, you have two module systems to choose from: CommonJS and ECMAScript Modules. Despite the recent rise of ESM, CommonJS is still widely used, and not to mention default in Node.js. To make sure your npm package can be used by everyone, you'll want to ...