Security News
npm Updates Search Experience with New Objective Sorting Options
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
This module is a part of yocto node modules for NodeJS.
Please see our NPM repository for complete list of available tools (completed day after day).
This module provide a simple sitemap generator based sitemap-generator.
Create an simple module that create a sftp client with SSH2 library.
This is an wrapper of SSH2 library. All methods handle automatic connect and close process to the ftp server.
Configure module, configuration object will be check by an Joi schema
var logger = require('yocto-logger');
var sftp = require('yocto-sftp')(logger);
var config = {
host : "10.10.10.10",
port : 22,
user : "test",
password : "pwd",
algorithms : {
serverHostKey: [ 'ssh-rsa', 'ssh-dss' ],
},
agent : process.env.SSH_AUTH_SOCK
};
// path dir to list
var pathDir = '/jumbodrive.re/ads/';
// connect
sftp.load(config).then(function () {
console.log('\n --> config success ... ');
// connect to client
sftp.connect().then(function(client) {
// the client is :
// {
// // ssh2 instance
// client : client,
// // sftp instance
// sftp : sftp
// }
console.log('\n --> connect success ');
setTimeout(function () {
console.log('\n --> end client connection ...');
// manually close the connect
sftp.end(client);
}, 2000);
}).catch(function (error) {
console.log('\n --> connect failed ', error);
});
}).catch(function (error) {
console.log('\n --> error : ', error);
});
This method download an file from sftp server
var localPathFile = '/toto';
var remotePathFile = '/tata';
// connect
sftp.load(config).then(function () {
console.log('\n --> config success ... ');
sftp.get(localPathFile, remotePathFile).then(function (list) {
console.log('\n --> ls success \n', list);
}).catch(function (error) {
console.log('\n --> ls failed ', error);
});
}).catch(function (error) {
console.log('\n --> error : ', error);
});
This method return an array of files description from ftp server
var remotePathFOlder = '/tata/';
// connect
sftp.load(config).then(function () {
console.log('\n --> config success ... ');
sftp.ls(remotePathFOlder).then(function (list) {
console.log('\n --> ls success \n', list);
}).catch(function (error) {
console.log('\n --> ls failed ', error);
});
}).catch(function (error) {
console.log('\n --> error : ', error);
});
This method remove an file in sftp server
var remotePathFile = '/tata.png';
// connect
sftp.load(config).then(function () {
console.log('\n --> config success ... ');
sftp.delete(remotePathFile).then(function (list) {
console.log('\n --> ls success \n', list);
}).catch(function (error) {
console.log('\n --> ls failed ', error);
});
}).catch(function (error) {
console.log('\n --> error : ', error);
});
This method upload an file in sftp server
var localPathFile = '/toto';
var remotePathFile = '/tata';
// connect
sftp.load(config).then(function () {
console.log('\n --> config success ... ');
sftp.put(localPathFile, remotePathFile).then(function (list) {
console.log('\n --> ls success \n', list);
}).catch(function (error) {
console.log('\n --> ls failed ', error);
});
}).catch(function (error) {
console.log('\n --> error : ', error);
});
This Check if an file exit on ftp server
var remotePathFile = '/tata';
// connect
sftp.load(config).then(function () {
console.log('\n --> config success ... ');
sftp.fileExist(remotePathFile).then(function (list) {
console.log('\n --> ls success \n', list);
}).catch(function (error) {
console.log('\n --> ls failed ', error);
});
}).catch(function (error) {
console.log('\n --> error : ', error);
});
0.1.0 (2017-02-28)
FAQs
This is an wrapper of SSH2 library to simply create sftp connection.
The npm package yocto-sftp receives a total of 1 weekly downloads. As such, yocto-sftp popularity was classified as not popular.
We found that yocto-sftp 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
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.