The next major version of NestJS is officially knocking on our doors, and it brings one of the most anticipated architectural shifts in the Node.js ecosystem: Full, first-class Native ESM support.

For years, developers have been trapped in the CommonJS (CJS) vs ECMAScript Modules (ESM) limbo. NestJS 12 aims to fix this.

I decided to put NestJS 12's capabilities to the test. I set up a small benchmark comparing a Native ESM setup against a classic CJS setup to see if expectations match reality.

Spoiler alert: The results might surprise you.

Setup