Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/tsmx/node-commonjs-to-esm
- Owner: tsmx
- License: mit
- Created: 2023-05-22T18:35:47.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-18T19:40:28.000Z (6 months ago)
- Last Synced: 2024-07-19T03:31:38.324Z (6 months ago)
- Topics: commonjs, ecmascript, esm, esmodules, nodejs
- Language: JavaScript
- Homepage: https://tsmx.net/convert-existing-nodejs-project-from-commonjs-to-esm/
- Size: 193 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
```