{"id":31392861,"url":"https://github.com/formidablelabs/node-esm-examples","last_synced_at":"2025-09-29T04:49:25.771Z","repository":{"id":42076398,"uuid":"408998187","full_name":"FormidableLabs/node-esm-examples","owner":"FormidableLabs","description":"Examples with Node.js runtimes and modern ESM support.","archived":false,"fork":false,"pushed_at":"2023-01-03T23:28:31.000Z","size":969,"stargazers_count":16,"open_issues_count":1,"forks_count":1,"subscribers_count":36,"default_branch":"main","last_synced_at":"2025-06-07T05:35:27.275Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FormidableLabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-21T23:02:16.000Z","updated_at":"2025-06-04T19:15:54.000Z","dependencies_parsed_at":"2023-02-01T13:25:12.294Z","dependency_job_id":null,"html_url":"https://github.com/FormidableLabs/node-esm-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FormidableLabs/node-esm-examples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FormidableLabs%2Fnode-esm-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FormidableLabs%2Fnode-esm-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FormidableLabs%2Fnode-esm-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FormidableLabs%2Fnode-esm-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FormidableLabs","download_url":"https://codeload.github.com/FormidableLabs/node-esm-examples/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FormidableLabs%2Fnode-esm-examples/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277467481,"owners_count":25822917,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-29T02:00:09.175Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-29T04:49:24.651Z","updated_at":"2025-09-29T04:49:25.766Z","avatar_url":"https://github.com/FormidableLabs.png","language":"JavaScript","readme":"[![Node.js ESM Examples — Formidable, We build the modern web](https://raw.githubusercontent.com/FormidableLabs/node-esm-examples/main/node-esm-examples-Hero.png)](https://formidable.com/open-source/)\n\n[![Maintenance Status][maintenance-image]](#maintenance-status)\n\nExamples with Node.js runtimes and modern ESM support.\n\n## Installation\n\nThe examples presently only run on a Bash-like OS / environment.\n\nStart with yarn installation:\n\n```sh\n$ yarn install\n```\n\nNext, you will need [nvm](https://github.com/nvm-sh/nvm) and the following Node.js **exact** runtimes:\n\n```sh\n$ nvm install 12.0.0\n$ nvm install 14.17.6\n```\n\nWe require the actual versions to speed up execution of known runtimes.\n\n## Run the examples\n\nTo see available [scenarios](./scenarios):\n\n```sh\n$ yarn scenarios\ndifferent-root\n...\n```\n\nTo run one of the scenarios in various node versions (e.g., `12`, `14`) and modes (CommonJS `CJS`, `ESM`):\n\n```sh\n# Form\n$ yarn scenario [NAME]\n[VERSION] [MODE] [OUTPUT]\n[VERSION] [MODE] [OUTPUT]\n...\n\n# Example\n$ yarn scenario different-root\n\n## different-root\nThe root exported file differs both by Node.js version _and_ mode.\n[12.0.0] [CJS] main.js - from package.main on old Node.js\n[14.17.6] [CJS] require.js - from package.exports root require match\n[14.17.6] [ESM] import.mjs - from package.exports root import match\n\n## dynamic-import\nAn ESM file is dynamically imported in both CommonJS and ESM code.\n[12.0.0] [CJS] error - UnhandledPromiseRejectionWarning: Error: Not supported\n[14.17.6] [CJS] import.mjs - ESM file\n[14.17.6] [ESM] import.mjs - ESM file\n\n## wrapper\nA core CommonJS index file is imported and re-exported by an ESM index file.\n[12.0.0] [CJS] index.cjs - core CJS code originally from index.cjs\n[14.17.6] [CJS] index.cjs - core CJS code originally from index.cjs\n[14.17.6] [ESM] wrapper.mjs - core CJS code originally from index.cjs\n```\n\nor just run `yarn scenario` to run **all** the scenarios!\n\n\n## Maintenance Status\n\n**Experimental:** This project is quite new. We're not sure what our ongoing maintenance plan for this project will be. Bug reports, feature requests and pull requests are welcome. If you like this project, let us know!\n\n[maintenance-image]: https://img.shields.io/badge/Maintenance-experimental-blueviolet\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformidablelabs%2Fnode-esm-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fformidablelabs%2Fnode-esm-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformidablelabs%2Fnode-esm-examples/lists"}