1.15.7 • Published 3 years ago

@stencila/executa v1.15.7

Weekly downloads
304
License
Apache-2.0
Repository
-
Last release
3 years ago

⚡ Executa

Execution engine for executable documents

Build Status Code coverage NPM

Install

npm install --global @stencila/executa

Use

All configuration options can be set, in descending order of priority, by:

  • a command line argument e.g. --<value> <value>
  • an environment variable prefixed with EXECUTA_ e.g. EXECUTA_<option>=<value>
  • a .json or .ini configuration file, set using the --config option, or .executarc by default
NameDescriptionTypeValidatorsDefault
debugDisplay debug log data?booleanfalse
stdioStart a stdio server.booleanfalse
vsockStart a vsock server.1boolean | numberfalse
tcpStart a TCP server.2boolean | stringpattern: /^((tcp?://)?([^:/]+)(:(d+))?(/(.+))?)|(d+)$/false
httpStart a HTTP server.3boolean | stringpattern: /^((https?://)?([^:/]+)(:(d+))?(/(.+))?)|(d+)$/false
wsStart a WebSocket server.4boolean | stringpattern: /^((wss?://)?([^:/]+)(:(d+))?(/(.+))?)|(d+)$/false
timeoutDuration of inactivity after which the process should stop.5number0
timelimitMaximum duration for the process.6number0
peersList of peer addresses.7string[]["stdio://*"]
queueLengthMaximum length of the request queue.8numberminimum: 01000
queueIntervalInterval between attempts to reduce request queue.9numberexclusiveMinimum: 01
queueStaleDuration after which a request is removed from queue.10numberexclusiveMinimum: 03600
  1. If a number, it will be used as the port number. If true, the default Vsock port 6000 will be used.
  2. If a string, it will be parsed and used as the address of the TCP server. If true, the default TCP address tcp://127.0.0.1:7000 will be used.
  3. If a string, it will be parsed and used as the address of the HTTP server. If true, the default HTTP address http://127.0.0.1:8000 will be used.
  4. If a string, it will be parsed and used as the address of the WebSocket server. If true, the default WebSocket address ws://127.0.0.1:9000 will be used.
  5. Seconds. Zero means no timeout.
  6. Seconds. Zero means no time limit.
  7. Each string in this list is parsed as an address to a peer executor. e.g. https://123.45.67.89/, docker://image
  8. When queue reaches this length, subsequent requests will fail with an error response to client.
  9. Seconds.
  10. Seconds. Client will be notified when a request is removed.

Develop

Testing with the REPL

There is an interactive REPL that can be used with the both query and execute CLI commands e.g.

npm run cli -- execute --repl --debug

Testing in the browser

  1. Serve Executa over HTTP (to provide static HTML) and WebSocket (to provide JSON RPC):

    npm run cli:dev -- serve --http --ws

The :dev suffix to cli uses ts-node-dev which will restart the process when any source files change.

  1. Visit http://localhost:8000 in your browser and play around with the <stencila-code-chunk> WebComponent that is connected to the Executa WebSocket that you just started.

npm.io

Debug inspecting

There is a NPM script, cli:debug, that can be useful for debugging the CLI, for example, from within VSCode (which will auto attach to the Node process), e.g.

npm run cli:debug -- serve --http

The :debug suffix to cli enables the Node debug inspector so you can use your favorite IDE to attach to the CLI and step through the code.

FAQ

Why is @types/ws a production dependency?

This package has several dependents e.g @stencila/basha. If @types/ws is not installed as a production dependency, when you try to build dependent packages, you get the error "Cannot find type definition file for 'ws'.". By having it as a production dependency here, each dependent package does not have to install it as a development dependency.

1.15.7

3 years ago

1.15.6

3 years ago

1.15.5

3 years ago

1.15.4

3 years ago

1.15.3

3 years ago

1.15.2

3 years ago

1.15.1

3 years ago

1.15.0

4 years ago

1.14.2

4 years ago

1.14.1

4 years ago

1.14.0

4 years ago

1.13.0

4 years ago

1.12.0

4 years ago

1.11.9

4 years ago

1.11.8

4 years ago

1.11.7

4 years ago

1.11.6

4 years ago

1.11.5

4 years ago

1.11.4

4 years ago

1.11.3

4 years ago

1.11.2

4 years ago

1.11.1

4 years ago

1.11.0

4 years ago

1.10.3

4 years ago

1.10.2

4 years ago

1.9.5

4 years ago

1.10.1

4 years ago

1.10.0

4 years ago

1.9.4

4 years ago

1.9.3

4 years ago

1.9.2

4 years ago

1.9.1

4 years ago

1.9.0

4 years ago

1.8.0

4 years ago

1.7.3

4 years ago

1.7.2

4 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.0

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago

0.15.0

4 years ago

0.14.3

4 years ago

0.14.2

4 years ago

0.14.1

4 years ago

0.14.0

4 years ago

0.13.0

4 years ago

0.12.0

4 years ago

0.11.3

4 years ago

0.11.2

4 years ago

0.11.1

4 years ago

0.11.0

4 years ago

0.10.0

4 years ago

0.9.0

4 years ago

0.8.1

4 years ago

0.8.0

4 years ago

0.7.1

4 years ago

0.7.0

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.0

5 years ago

0.4.0

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.0-next.2

5 years ago

0.2.0-next.1

5 years ago

0.2.0

5 years ago