Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tsmx/node-commonjs-to-esm

Example showing how to migrate an existing NodeJS project from CommonJS to ESM
https://github.com/tsmx/node-commonjs-to-esm

commonjs ecmascript esm esmodules nodejs

Last synced: about 2 months ago
JSON representation

Example showing how to migrate an existing NodeJS project from CommonJS to ESM

Awesome Lists containing this project

README

        

# node-commonjs-to-esm

> 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](https://tsmx.net/convert-existing-nodejs-project-from-commonjs-to-esm/).

To follow along with the guide, clone this repo an inspect the branches for CommonJS and ESM.

```bash
# 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
```