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

@runnerty/executor-shell

v3.2.0

Published

Runnerty module: shell executor

Downloads

70

Readme

NPM version Downloads Dependency Status

Shell executor for Runnerty

Installation:

Through NPM

npm i @runnerty/executor-shell

You can also add modules to your project with runnerty

npx runnerty add @runnerty/executor-shell

This command installs the module in your project, adds example configuration in your config.json and creates an example plan of use.

If you have installed runnerty globally you can include the module with this command:

runnerty add @runnerty/executor-shell

Configuration sample:

Add in config.json:

Local

{
  "id": "shell_default",
  "type": "@runnerty-executor-shell"
}

Remote (SSH)

{
  "id": "shell_ssh",
  "type": "@runnerty-executor-shell",
  "host": "remote.server.com",
  "username": "runnerty",
  "privateKey": "./ssh/privateKeyFile.pem"
}
SSH configuratión

Executor shell SSH connection relies on [mscdex/ssh2]:https://github.com/mscdex/ssh2 and these are the exposed options:

| Option | Type | Description | | ----------------- | --------------- | -------------------------------------------------------------------------------------------------------------------- | | host | string | Hostname or IP address of the server. | | port | number | Port number of the server. | | forceIPv4 | boolean | Only connect via resolved IPv4 address for host. | | forceIPv6 | boolean | Only connect via resolved IPv6 address for host. | | hostHash | "md5" or "sha1" | The host's key is hashed using this method and passed to hostVerifier. | | username | string | Username for authentication. | | password | string | Password for password-based user authentication. | | agent | string | Path to ssh-agent's UNIX socket for ssh-agent-based user authentication (or 'pageant' when using Pagent on Windows). | | privateKey | string | Path to the file that contains a private key for either key-based or hostbased user authentication (OpenSSH format). | | passphrase | string | For an encrypted private key, this is the passphrase used to decrypt it. | | localHostname | string | Along with localUsername and privateKey, set this to a non-empty string for hostbased user authentication. | | localUsername | string | Along with localHostname and privateKey, set this to a non-empty string for hostbased user authentication. | | tryKeyboard | boolean | Try keyboard-interactive user authentication if primary user authentication method fails. | | keepaliveInterval | number | How often (in milliseconds) to send SSH-level keepalive packets to the server. Set to 0 to disable. | | keepaliveCountMax | number | How many consecutive, unanswered SSH-level keepalive packets that can be sent to the server before disconnection. | | readyTimeout | number | * How long (in milliseconds) to wait for the SSH handshake to complete. | | strictVendor | boolean | Performs a strict server vendor check before sending vendor-specific requests. | | agentForward | boolean | Set to true to use OpenSSH agent forwarding ([email protected]) for the life of the connection. |

Plan sample:

Add in plan.json:

{
  "id": "shell_default",
  "command": "tar cvfz /var/backups/stf.tar /var/stranger_things/"
}
{
  "id": "shell_default",
  "command": "python",
  "args": ["myscript.py", "hello"]
}
{
  "id": "shell_default",
  "command": "echo",
  "args": ["hello world"]
}

Using the outputJSON param, if you have a process which returns a JSON object, the executor will generate automatically a value for each value of the object:

{
  "id": "shell_default",
  "command": "node my-returning-object-process.js"
}

This the output of my-returning-object-process.js:

{
  "name": "my output name",
  "lastName": "my output lastName"
}

Output values with the object's values. It is possible to access the values by GETVALUE function:

@GV(PROCESS_EXEC_JSON_NAME) --> "my output name"
@GV(PROCESS_EXEC_JSON_LASTNAME) --> "my output lastName"