Example showing how to migrate an existing NodeJS project from CommonJS to ESM
This is the accompanying example project for the CommonJS-to-ESM migration guide.
To follow along with the guide, clone this repo an inspect the branches for CommonJS and ESM.
# clone the example project
git clone https://github.com/tsmx/node-commonjs-to-esm.git
# install needed dependencies
cd node-commonjs-to-esm
npm install
# check out/switch to the original CommonJS project
git checkout commonjs
# check out/switch to the migrated ESM project
git checkout esm