This repository was archived by the owner on Apr 16, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +1
-19
lines changed Expand file tree Collapse file tree 2 files changed +1
-19
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ For now, only modules using the `file:` protocol can be loaded.
8686
8787## Interop with existing modules
8888
89- All CommonJS, JSON, and C++ modules can be used with ` import ` .
89+ CommonJS and C++ modules can be used with ` import ` .
9090
9191Modules loaded this way will only be loaded once, even if their query
9292or fragment string differs between ` import ` statements.
@@ -176,7 +176,6 @@ module. This can be one of the following:
176176| ` 'esm' ` | Load a standard JavaScript module |
177177| ` 'cjs' ` | Load a node-style CommonJS module |
178178| ` 'builtin' ` | Load a node builtin CommonJS module |
179- | ` 'json' ` | Load a JSON file |
180179| ` 'addon' ` | Load a [ C++ Addon] [ addons ] |
181180| ` 'dynamic' ` | Use a [ dynamic instantiate hook] [ ] |
182181
Original file line number Diff line number Diff line change @@ -86,20 +86,3 @@ translators.set('addon', async (url) => {
8686 reflect . exports . default . set ( module . exports ) ;
8787 } ) ;
8888} ) ;
89-
90- // Strategy for loading a JSON file
91- translators . set ( 'json' , async ( url ) => {
92- debug ( `Translating JSONModule ${ url } ` ) ;
93- return createDynamicModule ( [ 'default' ] , url , ( reflect ) => {
94- debug ( `Loading JSONModule ${ url } ` ) ;
95- const pathname = internalURLModule . fileURLToPath ( new URL ( url ) ) ;
96- const content = readFileSync ( pathname , 'utf8' ) ;
97- try {
98- const exports = JsonParse ( stripBOM ( content ) ) ;
99- reflect . exports . default . set ( exports ) ;
100- } catch ( err ) {
101- err . message = pathname + ': ' + err . message ;
102- throw err ;
103- }
104- } ) ;
105- } ) ;
You can’t perform that action at this time.
0 commit comments