@noego/ioc 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +2 -1
  2. package/readme.md +9 -0
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@noego/ioc",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "A self contained IoC container for Node.js",
5
5
  "main": "dist/cjs/index.js",
6
+ "module": "dist/esm/index.js",
6
7
  "types": "dist/esm/index.d.ts",
7
8
  "scripts": {
8
9
  "test": "jest --silent",
package/readme.md CHANGED
@@ -86,6 +86,15 @@ Follow these minimal steps to get @noego/ioc working in a TypeScript project:
86
86
  bootstrap();
87
87
  ```
88
88
 
89
+ ### ESM vs CJS imports
90
+
91
+ - Modern Node (>=14.13, >=16 recommended) and bundlers that honor `package.exports` can use either:
92
+ - `import { createContainer } from '@noego/ioc'`
93
+ - `import createContainer from '@noego/ioc'`
94
+ - If you see “does not provide an export named 'createContainer'”, your toolchain likely resolved the CommonJS build. Use this interop-safe pattern:
95
+ - `import pkg from '@noego/ioc'; const { createContainer } = pkg;`
96
+ - Or upgrade Node to a version that supports conditional exports.
97
+
89
98
  4. Run the entry file:
90
99
  ```bash
91
100
  npx ts-node index.ts