CoreUI ONE — 250+ PRO components and 25+ admin templates for React, Angular, Vue, Bootstrap and Next.js, plus Data Grid, Scheduler, 4,300+ PRO icons and the Next.js boilerplate. One license. → See what you get

How to import JSON in Node.js

Loading JSON data is fundamental in Node.js applications, whether for configuration files, test fixtures, or static data sets. As the creator of CoreUI, I’ve worked with JSON imports across countless production systems. The most straightforward approach depends on your module system: use require() for CommonJS or import with assertions for ES Modules. For dynamic loading or runtime flexibility, use fs.readFile() with JSON.parse() to load JSON files on demand.

Read More…

How to use CommonJS modules in Node.js

Organizing Node.js code into reusable modules is fundamental for building maintainable applications, and understanding the module system is crucial for every Node.js developer. As the creator of CoreUI, I’ve built countless server-side applications and npm packages using module systems. From my expertise, CommonJS remains the traditional and widely-supported module format in Node.js, using require() to import and module.exports to export functionality. This approach is synchronous, battle-tested, and compatible with the vast majority of npm packages in the ecosystem.

Read More…
Subscribe to our newsletter
Get early information about new products, product updates and blog posts.