Instructions
- 上传项目文件到FTP站点
- Upload project file to FTP site
Install
npm install site-ftp --save-dev
const { SiteFtp } = require('site-ftp');
SiteFtp.connect({
"host": "localhost",
"port": 21,
"username": "anonymous",
"password": "anonymous@",
"type": "ftp",
"from": ["dist/**"],
"to": "/public_html/",
"rm": true
});
node ftp.js
i {"host":"","port":21,"username":"","password":"","type":"ftp","from":["dist/**","src"],"to":"/public_html/","rm":true}
i Connecting...
i Deleting the ftp folder`/public_html/`
√ Successfully deleted the ftp folder`/public_html/`
i Uploading...
√ Finished!
Default Options
{
"host": "localhost",
"port": 21,
"username": "anonymous",
"password": "anonymous@",
"type": "ftp",
"from": ["dist/**"],
"to": "/public_html/",
"rm": true
}
TypeScript Options
export declare namespace SiteFtp {
interface SiteFtpOptions {
host?: string;
port?: number;
username?: string;
password?: string;
type?: string;
from?: Array<string>;
to?: string;
rm?: boolean | string;
}
export function connect(options: SiteFtpOptions): void;
export {};
}