diff --git a/src/082-cjs-vs-esm/206.5-can-import-cjs-into-esm.explainer/package.json b/src/082-cjs-vs-esm/206.5-can-import-cjs-into-esm.explainer/package.json new file mode 100644 index 0000000..8fdc251 --- /dev/null +++ b/src/082-cjs-vs-esm/206.5-can-import-cjs-into-esm.explainer/package.json @@ -0,0 +1,12 @@ +{ + "name": "117-const-enums.explainer", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "dev": "nodemon ./src/index.mjs" + }, + "keywords": [], + "author": "Matt Pocock", + "devDependencies": {} +} diff --git a/src/082-cjs-vs-esm/206.5-can-import-cjs-into-esm.explainer/pnpm-lock.yaml b/src/082-cjs-vs-esm/206.5-can-import-cjs-into-esm.explainer/pnpm-lock.yaml new file mode 100644 index 0000000..2b9f188 --- /dev/null +++ b/src/082-cjs-vs-esm/206.5-can-import-cjs-into-esm.explainer/pnpm-lock.yaml @@ -0,0 +1,5 @@ +lockfileVersion: '6.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false diff --git a/src/082-cjs-vs-esm/206.5-can-import-cjs-into-esm.explainer/src/cjs-module.cjs b/src/082-cjs-vs-esm/206.5-can-import-cjs-into-esm.explainer/src/cjs-module.cjs new file mode 100644 index 0000000..50adec8 --- /dev/null +++ b/src/082-cjs-vs-esm/206.5-can-import-cjs-into-esm.explainer/src/cjs-module.cjs @@ -0,0 +1,5 @@ +const hello = () => { + console.log("Hello!"); +}; + +module.exports = hello; diff --git a/src/082-cjs-vs-esm/206.5-can-import-cjs-into-esm.explainer/src/index.mjs b/src/082-cjs-vs-esm/206.5-can-import-cjs-into-esm.explainer/src/index.mjs new file mode 100644 index 0000000..ed7f44a --- /dev/null +++ b/src/082-cjs-vs-esm/206.5-can-import-cjs-into-esm.explainer/src/index.mjs @@ -0,0 +1,7 @@ +import hello from "./cjs-module.cjs"; + +const main = async () => { + hello(); +}; + +main();