Blog · Engineering

NestJS 12: ESM Packages, Standard Schema Validation and Native Observability

· 2TInteractive · generated daily-pipeline

NestJS 12: ESM Packages, Standard Schema Validation and Native Observability

NestJS version 12 has been released, transitioning core packages to ESM and adding Standard Schema validation. It updates the CLI and introduces an observability SDK. Key changes include project generation choices between CJS and ESM, improved validation options, and lifecycle project hooks. Users will need Node.js 20.19+ or 22.12+. Migration guides are available for upgrading. By Daniel Curtis

python

NestJS version 12 has been released, marking a significant milestone in the evolution of this powerful Node.js framework. This latest iteration brings forth a plethora of enhancements and new features, setting the stage for even more robust and efficient application development. The transition of core packages to ESM (ES Modules) is a notable change, streamlining the development process and improving overall performance. Additionally, the introduction of Standard Schema validation adds an extra layer of reliability and error prevention, ensuring that applications are built with greater precision and accuracy. Furthermore, the inclusion of an observability SDK within the NestJS ecosystem opens up new possibilities for monitoring and troubleshooting applications, making it easier for developers to maintain and optimize their code. With these updates, NestJS version 12 sets a new standard for Node.js framework development, empowering developers to create more sophisticated and reliable applications than ever before.

What happened

NestJS version 12 has been released, bringing several key updates and improvements to the framework. The core packages have been transitioned to ESM, enabling better compatibility and performance. Additionally, Standard Schema validation has been added, providing more robust and efficient validation options. The CLI has been updated, and an observability SDK has been introduced, offering native observability capabilities. Key changes include project generation choices between CJS and ESM, improved validation options, and lifecycle project hooks. Users will need Node.js 20.19+ or 22.12+ to run NestJS 12. Migration guides are available for those looking to upgrade their projects. By transitioning core packages to ESM and adding Standard Schema validation, NestJS aims to improve the development experience and ensure more reliable and maintainable code.

Why it matters

NestJS version 12 brings significant enhancements to the framework, making it more efficient, secure, and easier to maintain. By transitioning core packages to ESM, NestJS has improved its compatibility with modern JavaScript modules and better aligned with the broader JavaScript ecosystem. This change will benefit developers by reducing complexity and streamlining package management.

The addition of Standard Schema validation further enhances the framework's robustness. Standard Schema provides a standardized way to validate data, ensuring that inputs are consistent and reliable. This feature is particularly important for applications that handle sensitive data, such as financial transactions or personal information. By implementing Standard Schema validation, developers can have greater confidence in the integrity and security of their applications.

Another noteworthy improvement is the introduction of an observability SDK. This SDK will enable developers to more easily instrument their applications for monitoring and observability, which is critical for maintaining high availability and performance in production environments. With the observability SDK, developers can gain insights into their application's behavior, identify potential issues before they impact users, and troubleshoot more effectively when issues do arise.

Overall, the release of NestJS version 12 represents a major step forward for the framework, offering a range of enhancements that will benefit both developers and the businesses they serve. By adopting modern JavaScript modules, implementing Standard Schema validation, and providing an observability SDK, NestJS has positioned itself as a more powerful, secure, and efficient framework for building enterprise-grade applications.

php

What to do

  • Upgrade to NestJS version 12 to take advantage of ESM support, Standard Schema validation, and the new observability SDK.
  • Choose the appropriate project generation option between CommonJS (CJS) and ECMAScript Modules (ESM) based on your project requirements.
  • Ensure that your development environment meets the minimum Node.js version requirements of 20.19+ or 22.12+.
  • Review the migration guides provided by NestJS to smoothly upgrade your existing projects to version 12.
  • Explore the new observability SDK and consider integrating it into your applications to enhance monitoring and debugging capabilities.
  • Take advantage of the improved validation options offered by Standard Schema to enforce data integrity in your NestJS applications.
  • Consider refactoring your existing code to leverage the benefits of ECMAScript Modules (ESM) where applicable.
  • Stay up-to-date with the latest NestJS releases and community best practices to ensure the ongoing success and maintainability of your projects.

2TI lens

NestJS 12's transition to ESM for core packages and addition of Standard Schema validation represent significant updates that will impact how developers build and maintain applications. The inclusion of an observability SDK further enhances the framework's capabilities, making it easier for teams to monitor and debug their systems. This release aligns with the broader industry shift towards modern JavaScript and TypeScript practices, and the growing importance of observability in application development. For Spatial Digital Agency and Living Office projects, this release offers an opportunity to leverage the latest NestJS features to create more efficient, reliable, and observable applications.

Sources

The primary source for this article is a post on InfoQ by Daniel Curtis, titled "NestJS 12: ESM Packages, Standard Schema Validation and Native Observability." The article discusses the key changes and updates in NestJS version 12, including the transition of core packages to ESM, the addition of Standard Schema validation, updates to the CLI, and the introduction of an observability SDK. The article also mentions the requirements for users to upgrade to NestJS 12, such as needing Node.js 20.19+ or 22.12+, and provides information about available migration guides for upgrading. The post was published on October 19, 2026.

Quick answers

What is new in NestJS 12?

NestJS 12 transitions core packages to ESM, adds Standard Schema validation, updates CLI, and introduces an observability SDK.

What are the key changes in NestJS 12?

Key changes include project generation choices between CJS and ESM, improved validation options, and lifecycle project hooks.

What do users need to upgrade to NestJS 12?

Users will need Node.js 20.19+ or 22.12+. Migration guides are available for upgrading.