Support ESM and CommonJS Uses of Your Library
💡 Writing a Node.js library using ES Modules instead of Common JS?
👉🏼 Support users who aren't using ESM by adding a mapping for the main export for your library in your package.json file.
![Support ESM and CommonJS by setting exports[.].import for ESM and exports[.].require for CommonJS in package.json of your library.](/images/tips/supporting-esm-and-commonjs-library-users.png)
💡 Writing a Node.js library using ES Modules instead of Common JS?
👉🏼 Support users who aren't using ESM by adding a mapping for the main export for your library in your package.json file.