Have ideas to improve npm?Join in the discussion! »

    scp-promises

    0.5.0 • Public • Published

    scp-promises

    A Node.js module for asynchronous scp uploads and downloads. Inspired by node-scp, which is apparently no longer maintained.

    About

    CreateScpConnection returns an instance of Scp. The Scp object has get and send methods which return promises. If no password is passed to the options object during initialization, the password prompt is piped to the console.

    Getting Started

    Run simply npm install or yarn add to install scp-promises

    $ npm i scp-promises --save
    

    OR

    $ yarn add scp-promises
    
    import { CreateScpConnection }  from 'scp-promises'
    
    (async () => {
        try {
            const scp = CreateScpConnection({host: 'michm.de', user: 'jibblez'});
    
            await scp.send({path: '/home/jibblez/TESTFILE.dat', file: './README.md'});
            await scp.get({path: '/home/jibblez/TESTFILE.dat', file: './1233213.md'})
        }
        catch(error) {
            console.error(error);
        }
    })();

    Class Scp

    CreateScpConnection(options : @Object{})

    property description
    host URL or IP Address of the host
    user Login Username
    password Only neccessary if needed for login
    port 22 is default

    send(options : @Object{})

    property description
    path The path to the remote file
    file The local file

    get(options : @Object{})

    property description
    path The path to the remote file
    file The local file

    Fat properties are required.

    Keywords

    Install

    npm i scp-promises

    DownloadsWeekly Downloads

    7

    Version

    0.5.0

    License

    MIT

    Unpacked Size

    6.37 kB

    Total Files

    5

    Homepage

    michm.de

    Last publish

    Collaborators

    • avatar