NodeContext
Extends:
A Node.js context for executing Javascript code
Method Summary
Public Methods | ||
public |
async compileFile(file: String): Object Compile a Javascript source code file |
|
public |
async compileLibrary(src: String, dest: String, minify: Boolean): {"type": string, "name": *, "funcs": *, "bundle": *} Compile a Stencila library so that it can be loaded either into
a |
|
public |
async executeLibrary(library_: *): {"type": string, "name": *, "funcs": *} |
Inherited Summary
From class Context | ||
public get |
host: * |
|
public get |
id: * |
|
public get |
location: {"context": *, "host": *, "machine": *} |
|
public get |
name: * |
|
private |
_host: * |
|
private |
|
|
private |
_name: * |
|
private |
_variables: {} |
|
public |
async compile(cell: *): {"source": *, "expr": *, "global": *, "options": *, "inputs": *, "outputs": *, "messages": *} |
|
public |
async evaluate(node: *): * |
|
public |
async execute(cell: *): * |
|
public |
async libraries(): {} |
|
public |
async pack(value: *): * |
|
public |
async packPackage(value: *): {"type": *, "data": *} |
|
public |
async packPointer(objectPattern: {"type": *, "name": *, "preview": *}): {"type": *, "path": *, "preview": *} |
|
public |
async provide(what: *): * |
|
public |
async resolve(what: *): * |
|
public |
Unpack a data node into a native data value |
|
public |
async unpackPackage(pkg: *): * |
|
public |
async unpackPointer(pointer: *): * |
From class JavascriptContext | ||
private |
Libraries registered in this context |
|
private |
Variables residing in this context |
|
public |
Compile a cell |
|
public |
async evaluateCall(call: *): * |
|
public |
async evaluateGet(get: *): * |
|
public |
async execute(cell: *): * |
|
public |
async libraries(): * Get the libraries registered in this context |
|
public |
async pack(value: *): * Pack a value |
|
public |
async variables(): * Get the variables residing in this context |
|
private |
_compileFunction(name: *, decl: *, source: *, docs: *): * |
Public Methods
public async compileFile(file: String): Object source
Compile a Javascript source code file
Params:
Name | Type | Attribute | Description |
file | String | File path |
public async compileLibrary(src: String, dest: String, minify: Boolean): {"type": string, "name": *, "funcs": *, "bundle": *} source
Compile a Stencila library so that it can be loaded either into
a NodeContext
or another JavascriptContext
(e.g one embedded
into a Stencila web or desktop interface).
Creates a Javascript bundle which exports both function definitions and a function specification objects.