run-on-ssh
v1.1.1
Published
Run a node.js script on a given ssh server
Downloads
6
Readme
run-on-ssh
Run a node.js script on a given ssh server
Installation
npm install run-on-ssh --save
Usage
var runOnSsh = require('run-on-ssh');
var runCommand = runOnSsh({
// see https://www.npmjs.com/package/ssh2 .connect for `remote` option.
remote: {host, password},
directory: __dirname + '/path/to/folder',
nodeVersion: 'v6.4.0', // defaults to `process.version`
// N.B. debug defaults to false if `process.env.NODE_ENV === 'production'`
debug: false,
});
runCommand({
env: {MY_ENV_VAR: 'foo'}, // defaults to `{}` so you don't accidentally expose your environment
args: ['bar'], // defaults to `[]`
}).then(res => assert(res === '00017foobar\n'));
License
MIT