esm-sync 3.3.3-beta.0 → 3.3.3-beta.2
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.
- package/esm/loader.js +1 -1
- package/index.d.ts +27 -0
- package/package.json +3 -1
package/index.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/// <reference types="node"/>
|
|
2
|
+
|
|
3
|
+
declare namespace Options {
|
|
4
|
+
interface Esm {
|
|
5
|
+
cache: boolean;
|
|
6
|
+
esModule: boolean;
|
|
7
|
+
extensions: boolean;
|
|
8
|
+
mutableNamespace: boolean;
|
|
9
|
+
namedExports: boolean;
|
|
10
|
+
paths: boolean;
|
|
11
|
+
vars: boolean;
|
|
12
|
+
dedefault: boolean;
|
|
13
|
+
topLevelReturn: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface Options {
|
|
17
|
+
cjs: boolean | Partial<Esm>;
|
|
18
|
+
mainFields: string[];
|
|
19
|
+
mode: "auto" | "all" | "strict";
|
|
20
|
+
await: boolean;
|
|
21
|
+
force: boolean;
|
|
22
|
+
wasm: boolean;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
declare function esm(mod: typeof module, options?: Partial<Options.Options>): typeof require;
|
|
27
|
+
export = esm;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "esm-sync",
|
|
3
|
-
"version": "3.3.3-beta.
|
|
3
|
+
"version": "3.3.3-beta.2",
|
|
4
4
|
"description": "Tomorrow's ECMAScript modules today!",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"commonjs",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"author": "Khiet Tam Nguyen <tamkhietnguyen1@gmail.com>",
|
|
20
20
|
"main": "esm.js",
|
|
21
|
+
"types": "index.d.ts",
|
|
21
22
|
"private": false,
|
|
22
23
|
"runkitExample": "require = require(\"@nktnet1/esm\")(module)\nrequire(\"lodash-es\")",
|
|
23
24
|
"esm": true,
|
|
@@ -115,6 +116,7 @@
|
|
|
115
116
|
},
|
|
116
117
|
"files": [
|
|
117
118
|
"index.js",
|
|
119
|
+
"index.d.ts",
|
|
118
120
|
"esm.js",
|
|
119
121
|
"esm/loader.js"
|
|
120
122
|
],
|