Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
automatedsftpsender
Advanced tools
Readme
Watches your project folder, and sends changes to server via SFTP.
constructor(connectConfig: ConnectConfig, remotePath: string)
ConnectConfig: See https://github.com/mscdex/ssh2#client-methods connect(< object >config)
remotePath: the server
folder path where you want to synchronize with your project folder
connect()
connects to server
watch(watchPath: string, options?: chokidar.WatchOptions)
watchPath: your project
folder where you want to synchronize with the server folder
options?: see https://github.com/paulmillr/chokidar#api options
starts watching your project folder.
upload (clientPath: string, serverPath: string)
delete (serverPath: string)
mkdir (serverPath: string)
rmdir (serverPath: string)
clientPath: path of your project file
serverPath: path where your project file goes | path of the server file / folder that will be created / deleted
these methods will be executed when your project files change, but you can also execute directly.
setFilter (filter: (filePath: string, type: string) => boolean)
filter: filter function
type: event type (add|change|unlink|addDir|unlinkDir)
Filters whether your changed files will be sent to server or not. (true: send, false: ignore)
import AutomatedSFTPSender from 'automatedsftpsender'
import path from 'path'
const sender = new AutomatedSFTPSender({
host: 'example.com', // Your server host
port: 22, // SFTP port
username: 'admin',
password: 'admin'
}, '/root/server/build') // where your project file will be synchronized
sender.connect() // connects to server
sender.watch(path.resolve(__dirname, 'build'), { // ./build/ folder will be synchronized
ignoreInitial: true // ignores initial detection. if false, error can be thrown
})
FAQs
Automated SFTP Sender (File Watch)
The npm package automatedsftpsender receives a total of 7 weekly downloads. As such, automatedsftpsender popularity was classified as not popular.
We found that automatedsftpsender 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.