Skip to content

Commit 9a1a2da

Browse files
committed
Document more defaults and options.
1 parent 717f04b commit 9a1a2da

File tree

1 file changed

+38
-32
lines changed

1 file changed

+38
-32
lines changed

README.md

+38-32
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,7 @@ Specify options with one of the following:
8383
<td colspan="2"><code>{</code></td>
8484
</tr>
8585
<tr>
86-
<td valign="top"><code>"await":</code></td>
87-
<td>
88-
<p>A boolean for top-level <a href="https://node.green/#ES2018-features-Asynchronous-Iterators-async-generators"><code>await</code></a> in modules <a href="https://github.com/mylesborins/proposal-top-level-await/#optional-constraint-top-level-await-can-only-be-used-in-modules-without-exports">without ESM exports</a>. <em>(Node 10+)</em></p>
89-
</td>
90-
</tr>
91-
<tr>
92-
<td valign="top"><code>"cjs":</code></td>
86+
<td valign="top"><code>"cjs":true</code></td>
9387
<td>
9488
<p>A boolean or object for toggling CJS features in ESM.</p>
9589
<details>
@@ -99,53 +93,59 @@ Specify options with one of the following:
9993
<td colspan="2"><code>{</code></td>
10094
</tr>
10195
<tr>
102-
<td valign="top"><code>"cache":</code></td>
96+
<td valign="top"><code>"cache":true</code></td>
10397
<td>
10498
<p>A boolean for storing ES modules in <code>require.cache</code>.</p>
10599
</td>
106100
</tr>
107101
<tr>
108-
<td valign="top"><code>"dedefault":</code></td>
109-
<td>
110-
<p>A boolean to export a default without the dangling <code>require().default`</code>.</p>
111-
</td>
112-
</tr>
113-
<tr>
114-
<td valign="top"><code>"esModule":</code></td>
102+
<td valign="top"><code>"esModule":true</code></td>
115103
<td>
116104
<p>A boolean for <code>__esModule</code> interoperability.</p>
117105
</td>
118106
</tr>
119107
<tr>
120-
<td valign="top"><code>"extensions":</code></td>
108+
<td valign="top"><code>"extensions":true</code></td>
121109
<td>
122110
<p>A boolean for respecting <code>require.extensions</code> in ESM.</p>
123111
</td>
124112
</tr>
125113
<tr>
126-
<td valign="top"><code>"mutableNamespace":</code></td>
114+
<td valign="top"><code>"mutableNamespace":true</code></td>
127115
<td>
128116
<p>A boolean for mutable <a href="https://ponyfoo.com/articles/es6-modules-in-depth#import-all-the-things">namespace objects</a>.</p>
129117
</td>
130118
</tr>
131119
<tr>
132-
<td valign="top"><code>"namedExports":</code></td>
120+
<td valign="top"><code>"namedExports":true</code></td>
133121
<td>
134122
<p>A boolean for <a href="https://ponyfoo.com/articles/es6-modules-in-depth#importing-named-exports">importing named exports</a> of CJS modules.</p>
135123
</td>
136124
</tr>
137125
<tr>
138-
<td valign="top"><code>"paths":</code></td>
126+
<td valign="top"><code>"paths":true</code></td>
139127
<td>
140128
<p>A boolean for following CJS <a href="https://github.com/nodejs/node-eps/blob/master/002-es-modules.md#432-removal-of-non-local-dependencies">path rules</a> in ESM.</p>
141129
</td>
142130
</tr>
143131
<tr>
144-
<td valign="top"><code>"vars":</code></td>
132+
<td valign="top"><code>"vars":true</code></td>
145133
<td>
146134
<p>A boolean for <code>__dirname</code>, <code>__filename</code>, and <code>require</code> in ESM.</p>
147135
</td>
148136
</tr>
137+
<tr>
138+
<td valign="top"><code>"dedefault":false</code></td>
139+
<td>
140+
<p>A boolean for requiring ES modules without the dangling <code>require().default</code>.</p>
141+
</td>
142+
</tr>
143+
<tr>
144+
<td valign="top"><code>"topLevelReturn":false</code></td>
145+
<td>
146+
<p>A boolean for top-level <code>return</code> support.</p>
147+
</td>
148+
</tr>
149149
<tr>
150150
<td colspan="2"><code>}</code></td>
151151
</tr>
@@ -154,19 +154,13 @@ Specify options with one of the following:
154154
</td>
155155
</tr>
156156
<tr>
157-
<td valign="top"><code>"force":</code></td>
158-
<td>
159-
<p>A boolean to apply these options to all module loads.</p>
160-
</td>
161-
</tr>
162-
<tr>
163-
<td valign="top"><code>"mainFields":</code></td>
157+
<td valign="top"><code>"mainFields":["main"]</code></td>
164158
<td>
165-
<p>An array of fields, e.g. <code>["main"]</code>, checked when importing a package.</p>
159+
<p>An array of fields checked when importing a package.</p>
166160
</td>
167161
</tr>
168162
<tr>
169-
<td valign="top"><code>"mode":</code></td>
163+
<td valign="top"><code>"mode":"auto"</code></td>
170164
<td>
171165
<p>A string mode:</p>
172166
<ul>
@@ -177,7 +171,19 @@ Specify options with one of the following:
177171
</td>
178172
</tr>
179173
<tr>
180-
<td valign="top"><code>"wasm":</code></td>
174+
<td valign="top"><code>"await": false</code></td>
175+
<td>
176+
<p>A boolean for top-level <a href="https://node.green/#ES2018-features-Asynchronous-Iterators-async-generators"><code>await</code></a> in modules <a href="https://github.com/mylesborins/proposal-top-level-await/#optional-constraint-top-level-await-can-only-be-used-in-modules-without-exports">without ESM exports</a>. <em>(Node 10+)</em></p>
177+
</td>
178+
</tr>
179+
<tr>
180+
<td valign="top"><code>"force":false</code></td>
181+
<td>
182+
<p>A boolean to apply these options to all module loads.</p>
183+
</td>
184+
</tr>
185+
<tr>
186+
<td valign="top"><code>"wasm":false</code></td>
181187
<td>
182188
<p>A boolean for <a href="https://nodejs.org/api/globals.html#globals_webassembly">WebAssembly</a> module support. <em>(Node 8+)</em></p>
183189
</td>
@@ -195,13 +201,13 @@ DevOpts
195201
<td colspan="2"><code>{</code></td>
196202
</tr>
197203
<tr>
198-
<td valign="top"><code>"cache":</code></td>
204+
<td valign="top"><code>"cache":true</code></td>
199205
<td>
200206
<p>A boolean for toggling cache creation or cache directory path.</p>
201207
</td>
202208
</tr>
203209
<tr>
204-
<td valign="top"><code>"sourceMap":</code></td>
210+
<td valign="top"><code>"sourceMap":false</code></td>
205211
<td>
206212
<p>A boolean for including inline source maps.</p>
207213
</td>

0 commit comments

Comments
 (0)