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: README.md
+28-16Lines changed: 28 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,11 +9,10 @@ Node.js utility for transforming a JavaScript or TypeScript file from an ES modu
9
9
- ES module ➡️ CommonJS
10
10
- CommonJS ➡️ ES module
11
11
12
-
By default `@knighted/module` transforms the one-to-one [differences between ES modules and CommonJS](https://nodejs.org/api/esm.html#differences-between-es-modules-and-commonjs), but it also accepts options that allow:
12
+
> [!IMPORTANT]
13
+
> All parsing logic is applied under the assumption the code is in [strict mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode) which [modules run under by default](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules#other_differences_between_modules_and_classic_scripts).
13
14
14
-
- Converting `import`/`export` to `require`/`exports`
15
-
- Extensions to be updated in relative specifiers
16
-
- Write transformed source code to a filename
15
+
By default `@knighted/module` transforms the one-to-one [differences between ES modules and CommonJS](https://nodejs.org/api/esm.html#differences-between-es-modules-and-commonjs). Options let you control syntax rewriting, specifier updates, and output.
17
16
18
17
## Requirements
19
18
@@ -47,9 +46,8 @@ You can transform it to the equivalent CommonJS module
0 commit comments