turtle-ftp-deploy
v1.0.0
Published
Using FTP and SFTP to deploy projects.
Downloads
3
Readme
turtle-ftp-deploy
Using FTP and SFTP to deploy projects.
Installation
npm install --save-dev turtle-ftp-deploy
Usage
The most basic usage:
var FtpDeploy = require("turtle-ftp-deploy");
var config = {
host: 'localhost',
port: 22,
user: 'root',
password: '123456',
localRoot: path.join(__dirname, './public'),
remoteRoot: '/root/turtle-ftp-deploy/',
include: ['**/*'],
exclude: ['*.js.map'],
backup: true,
backupRoot: path.join(__dirname, './backup'),
deleteRemote: true,
sftp: true,
};
var ftpDeploy = new FtpDeploy(config);
ftpDeploy
.deploy()
.then((res) => console.log('finished.'))
.catch((err) => console.log('err', err));
ftpDeploy.on('log', (data) => console.log('[log]', data));