![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
sftp-promises-with-promises
Advanced tools
SFTP Promise wrapper for ssh2 SFTP commands with blueBird promises lib
SFTP Promise Wrapper for ssh2
Support basic SFTP transaction with promises, specifically for fronting SFTP with a web based API using something like Koa
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.
The current streams implementation requires supplying either readable or writable streams and do not return promises with streams like the getBuffer method. This is to support non-presistent connections which would drop if a stream was returned on the promise resolve.
One connection per call
var config = {host: 'localhost', username: 'user', password: 'pass' };
var SFTPClient = require('sftp-promises');
var sftp = new SFTPClient(config);
sftp.ls('~/').then(function(list) { console.log(list) })
Persistent Session calls (Experimental)
var config = {host: 'localhost', username: 'user', password: 'pass' };
var SFTPClient = require('sftp-promises');
var sftp = new SFTPClient();
// get session
var session = sftp.session(config).then(function(ftpSession) { session = ftpSession })
...code to ensure session is ready...
sftp.ls('~/', session).then(function(list) { console.log(list) })
// close socket
session.end()
config options are the same as ssh2 config options.
All calls take an optional ssh2 Connction object as the final arguement for using persistent session.
sftp.stat(<string>remote_path, [ssh2.Connection]session) returns a promise with on object containing path attributes
sftp.ls(<string>remote_path, [ssh2.Connection]session) returns a promise with an object descibing the path
sftp.getBuffer(<string>remote_path, [ssh2.Connection]session) returns a promise with a buffer containing the file contents
sftp.putBuffer(<Buffer>data, <string>remote_path, [ssh2.Connection]session) returns a promise with a boolean, true if successful
sftp.get(<string>remote_path, <string>local_path, [ssh2.Connection]session) returns a promise with a boolean, true if successful
sftp.put(<string>local_path, <string>remote_path, [ssh2.Connection]session) returns a promise with a boolean, true if successful
sftp.rm(<string>location, [ssh2.Connection]session) returns a promise with a boolean, true if successful
sftp.mv(<string>src, <string>dest, [ssh2.Connection]session) returns a promise with a boolean, true if successful
sftp.mkdir(<string>path, [ssh2.Connection]session) returns a promise with a boolean, true if successful
sftp.rmdir(<string>path, [ssh2.Connection]session) returns a promise with a boolean, true if successful
sftp.getStream(<string>path, writableStream, [ssh2.Connection]session) returns a promise with a boolean, true if stream write completed
sftp.putStream(<string>path, writableStream, [ssh2.Connection]session) returns a promise with a boolean, true is stream write completed
FAQs
SFTP Promise wrapper for ssh2 SFTP commands with blueBird promises lib
The npm package sftp-promises-with-promises receives a total of 1 weekly downloads. As such, sftp-promises-with-promises popularity was classified as not popular.
We found that sftp-promises-with-promises demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.