0.2.2 • Published 9 years ago

worksmith_sftp v0.2.2

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

worksmith_sftp

SFTP activities for worksmith

This package contains the following activities/tasks:

namedescription
connectConnects the underlying sftp client
disconnectDisconnects the underlying sftp client
commandExecutes the specified sftp command

connect-activity activity

Connects the underlying sftp client

params
nametypedescription
configobjectConnection parameters (see whoosh)
example
var worksmith = require('worksmith')
worksmith.use('sftp', require('worksmith_sftp'))
var workflow = worksmith({task:'sequence', items : [{
    task:'sftp/connect',
    config: {
        hostname: 'sftp.example.com',
        port: 22,
        username: 'fred',
        password: 'secret'
    },
    resultTo: 'sftp'
}])

disconnect activity

Disconnects the underlying sftp client

params
nametypedescription
sftpsftp clientThe sftp client (if not specified expected to be in the context 'sftp' property)
example
var worksmith = require('worksmith')
worksmith.use('sftp', require('worksmith_sftp'))
var workflow = worksmith({task:'sequence', items : [{
    task:'sftp/connect',
    config: {
        hostname: 'sftp.example.com',
        port: 22,
        username: 'fred',
        password: 'secret'
    },
    resultTo: 'sftp'
}, {
    task: 'sftp/disconnect',
    sftp: '@sftp'
}])

command activity

Executes the specified sftp command

params
nametypedescription
sftpsftp clientThe sftp client (if not specified expected to be in the context 'sftp' property)
commandstringThe command to execute (see whoosh)
argumentsarrayThe array of parameters to pass to the command
example
var worksmith = require('worksmith')
worksmith.use('sftp', require('worksmith_sftp'))
var workflow = worksmith({task:'sequence', items : [{
    task:'sftp/connect',
    config: {
        hostname: 'sftp.example.com',
        port: 22,
        username: 'fred',
        password: 'secret'
    },
    resultTo: 'sftp'
}, {
    task: 'sftp/command',
    command: 'stat',
    arguments: ['.']
}, {
    task: 'sftp/disconnect',
    sftp: '@sftp'
}])

Running tests

You need an sftp server running on localhost:10022 for the tests to pass. If you have docker and docker-compose installed simply run docker-compose up in the route of this project.

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.1

9 years ago