File tree 4 files changed +8
-8
lines changed
4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 3
3
// Wrapping function and interface example
4
4
5
5
global . api = { } ;
6
- api . fs = require ( 'fs' ) ;
7
- api . vm = require ( 'vm' ) ;
6
+ api . fs = require ( 'node: fs' ) ;
7
+ api . vm = require ( 'node: vm' ) ;
8
8
9
9
// Create a hash for application sandbox
10
10
const context = {
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
3
global . api = { } ;
4
- api . fs = require ( 'fs' ) ;
5
- api . vm = require ( 'vm' ) ;
4
+ api . fs = require ( 'node: fs' ) ;
5
+ api . vm = require ( 'node: vm' ) ;
6
6
7
7
const wrapFunction = ( fnName , fn ) => ( ...args ) => {
8
8
if ( args . length > 0 ) {
Original file line number Diff line number Diff line change 6
6
7
7
// The framework can require core libraries
8
8
global . api = { } ;
9
- api . fs = require ( 'fs' ) ;
10
- api . vm = require ( 'vm' ) ;
9
+ api . fs = require ( 'node: fs' ) ;
10
+ api . vm = require ( 'node: vm' ) ;
11
11
12
12
// Create a hash and turn it into the sandboxed context which will be
13
13
// the global context of an application
Original file line number Diff line number Diff line change 7
7
8
8
// Фреймворк может явно зависеть от библиотек через dependency lookup
9
9
global . api = { } ;
10
- api . fs = require ( 'fs' ) ;
11
- api . vm = require ( 'vm' ) ;
10
+ api . fs = require ( 'node: fs' ) ;
11
+ api . vm = require ( 'node: vm' ) ;
12
12
13
13
// Создаем контекст-песочницу, которая станет глобальным контекстом приложения
14
14
const context = { } ; // module: {}, /*console: console*/ };
You can’t perform that action at this time.
0 commit comments