npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@stencila/executa

v1.15.7

Published

Document executors: protocols, transports and reference implementations

Downloads

148

Readme

⚡ 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

| Name | Description | Type | Validators | Default | | ------------- | ------------------------------------------------------------------------------------------------------ | ------------------ | ---------------------------------------------------------- | --------------- | | debug | Display debug log data? | boolean | | false | | stdio | Start a stdio server. | boolean | | false | | vsock | Start a vsock server.1 | boolean | number | | false | | tcp | Start a TCP server.2 | boolean | string | pattern: /^((tcp?://)?([^:/]+)(:(d+))?(/(.+))?)|(d+)$/ | false | | http | Start a HTTP server.3 | boolean | string | pattern: /^((https?://)?([^:/]+)(:(d+))?(/(.+))?)|(d+)$/ | false | | ws | Start a WebSocket server.4 | boolean | string | pattern: /^((wss?://)?([^:/]+)(:(d+))?(/(.+))?)|(d+)$/ | false | | timeout | Duration of inactivity after which the process should stop.5 | number | | 0 | | timelimit | Maximum duration for the process.6 | number | | 0 | | peers | List of peer addresses.7 | string[] | | ["stdio://*"] | | queueLength | Maximum length of the request queue.8 | number | minimum: 0 | 1000 | | queueInterval | Interval between attempts to reduce request queue.9 | number | exclusiveMinimum: 0 | 1 | | queueStale | Duration after which a request is removed from queue.10 | number | exclusiveMinimum: 0 | 3600 |

  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.

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.