You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/USAGE.md
+35Lines changed: 35 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,41 @@ npm config list
49
49
npm install @mitre-attack/attack-data-model
50
50
```
51
51
52
+
## Module Format Support
53
+
54
+
The ATT&CK Data Model is built using [tsup](https://github.com/egoist/tsup), which compiles the TypeScript code to both ESM (ECMAScript Modules) and CJS (CommonJS) formats. This dual-format approach allows the library to be used in various JavaScript environments:
55
+
56
+
-**ESM**: Modern environments that support ES modules (Node.js with `"type": "module"` in package.json, or modern bundlers like Webpack, Rollup, etc.)
57
+
-**CJS**: Traditional Node.js applications and environments that use CommonJS modules (Node.js with `"type": "commonjs"` in package.json)
58
+
59
+
### ESM Usage Example
60
+
61
+
```javascript
62
+
// In a package with "type": "module" in package.json
0 commit comments