This implementation walks the document and collects NPM package names
from the imports property of Javascript CodeChunk nodes. It then
calls npm install with the names of the packages missing from package.json.
If there is no package.json file then will create one.
Parameters
this: Jesta
node: Node
force: boolean
Returns Promise<Node>
call
call:((this, name, args) => Promise<Node>)
Type declaration
(this, name, args): Promise<Node>
Call a function within a document.
Parameters
this: Jesta
name: string
The name of the function
args: Record<string, Node>
Arguments to call the document or function with
Returns Promise<Node>
clean
clean:((this, node) => Promise<Node>)
Type declaration
(this, node): Promise<Node>
Parameters
this: Jesta
node: Node
Returns Promise<Node>
cli
cli:((this) => void)
Type declaration
(this): void
Expose a command line interface for the plugin.
The command line interface is intended to be simple and mainly
for use by plugin developers and users that want to use
plugins standalone.
Note: This function is a simple wrapper around the run function that
passes it the args vector and exits on error.
Returns a map of the name and type signature of the current document's functions.
See vars for an analogous method returning variables and their types.
Parameters
this: Jesta
Returns Promise<Record<string, string>>
get
get:typeof get
import
import:typeof import_
pipe
pipe:((this, node, calls) => Promise<Node>)
Type declaration
(this, node, calls): Promise<Node>
Parameters
this: Jesta
node: Node
calls: Method[]
Returns Promise<Node>
pull
pull:typeof pull
read
read:typeof read
select
select:typeof select
serve
serve:((this) => Promise<void>)
Type declaration
(this): Promise<void>
Serve the plugin.
Parameters
this: Jesta
Returns Promise<void>
set
set:typeof set
upcast
upcast:((this, node) => Promise<Node>)
Type declaration
(this, node): Promise<Node>
Parameters
this: Jesta
node: Node
Returns Promise<Node>
validate
validate:typeof validate
vars
vars:((this) => Promise<Record<string, string>>)
Type declaration
(this): Promise<Record<string, string>>
List variables of the current document.
Returns a map of the name and type of the current document's variables.
See funcs for an analogous method returning functions and their type signature.
Build a document
This implementation walks the document and collects NPM package names from the
imports
property of JavascriptCodeChunk
nodes. It then callsnpm install
with the names of the packages missing frompackage.json
. If there is nopackage.json
file then will create one.