mirror of https://github.com/embarklabs/embark.git
Format API docs for code-runner
parent
420effbafe
commit
09477da848
|
@ -182,32 +182,32 @@ module type: core component
|
||||||
|
|
||||||
##### requests
|
##### requests
|
||||||
|
|
||||||
name: 'runcode:register'
|
name: `runcode:register`
|
||||||
arguments:
|
arguments:
|
||||||
* varName {string} - name of the variable to be registered in the VM
|
* `varName` {string} - name of the variable to be registered in the VM
|
||||||
* code {any} - primitive or object value that will be assign to `varName` inside the VM
|
* `code` {any} - primitive or object value that will be assign to `varName` inside the VM
|
||||||
|
|
||||||
Registers a variable and assigns a value to it inside the VM context.
|
Registers a variable and assigns a value to it inside the VM context.
|
||||||
|
|
||||||
name: 'runcode:whitelist'
|
name: 'runcode:whitelist'
|
||||||
arguments:
|
arguments:
|
||||||
* varName {string} - name of white node module to be whitelisted for imports inside the VM
|
* `varName` {string} - name of white node module to be whitelisted for imports inside the VM
|
||||||
|
|
||||||
Whitelists a node module inside the VM context for imports. Generally, the VM context is
|
Whitelists a node module inside the VM context for imports. Generally, the VM context is
|
||||||
sandboxed, making it impossible to require/import any arbitrary module. This API enables
|
sandboxed, making it impossible to require/import any arbitrary module. This API enables
|
||||||
whitelisting of such modules.
|
whitelisting of such modules.
|
||||||
|
|
||||||
name : 'runcode:getContext'
|
name : `runcode:getContext`
|
||||||
|
|
||||||
Returns the current VM context with its sandbox object and options.
|
Returns the current VM context with its sandbox object and options.
|
||||||
|
|
||||||
name: 'runcode:eval'
|
name: `runcode:eval`
|
||||||
arguments:
|
arguments:
|
||||||
* code {string} - code to be eval'd inside the sandboxed VM
|
* `code` {string} - code to be eval'd inside the sandboxed VM
|
||||||
* cb {function} - callback to be called when the evaluation is done
|
* `cb` {function} - callback to be called when the evaluation is done
|
||||||
* tolerateError {boolean}, default: false - If set to true, errors inside the VM are logged (instead of calling back with an error object)
|
* `tolerateError` {boolean}, default: false - If set to true, errors inside the VM are logged (instead of calling back with an error object)
|
||||||
* logCode {boolean}, default: true - log the code if it caused an error
|
* `logCode` {boolean}, default: true - log the code if it caused an error
|
||||||
* logError {boolean}, default: true - Also logs the error if there is one emitted by the VM
|
* `logError` {boolean}, default: true - Also logs the error if there is one emitted by the VM
|
||||||
|
|
||||||
Runs given code inside a sandboxed VM.
|
Runs given code inside a sandboxed VM.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue