New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sftp-promises

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sftp-promises

SFTP Promise wrapper for ssh2 SFTP commands

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.4K
decreased by-10.83%
Maintainers
1
Weekly downloads
 
Created
Source

sftp-promises

SFTP Promise Wrapper for ssh2

Support basic SFTP transaction with promises, specifically for fronting SFTP with a web based API using something like Koa

Warning

Each request will create a new conneciton and close it when finished, this is by design as its intended to be used in stateless web applications. As such care should exercised when using on high traffic systems to avoid too many connections to SFTP server and general connection overhead.

Usage

 var config = {host: 'localhost', username: 'user', password: 'pass' };
 var sftp = require('sftp-promises')(config);
 
 sftp.ls('~/').then(function(list) { console.log(list) })

Support calls

  • sftp.ls(<string>remote_path) returns a promise with an object descibing the path
  • sftp.getBuffer(<string>remote_path) returns a promise with a buffer containing the file contents
  • sftp.putBuffer(<Buffer>data, remote_path) returns a promise with a boolean, true if successful
  • sftp.get(<string>remote_path, local_path) returns a promise with a boolean, true if successful
  • sftp.put(<string>local_path, remote_path) returns a promise with a boolean, true if successful
  • sftp.rm(<string>location) returns a promise with a boolean, true if successful
  • sftp.mv(<string>src, dest) returns a promise with a boolean, true if successful

Keywords

FAQs

Package last updated on 26 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc