1.3.0 • Published 4 years ago

site-ftp v1.3.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

Instructions

  • 上传项目文件到FTP站点
  • Upload project file to FTP site

Install

npm install site-ftp --save-dev
  • create a file ftp.js
const { SiteFtp } = require('site-ftp');
SiteFtp.connect({
    "host": "localhost",
    "port": 21,
    "username": "anonymous",
    "password": "anonymous@",
    "type": "ftp",
    "from": ["dist/**"],
    "to": "/public_html/",
    "rm": true
});
  • run node
node ftp.js
  • console √ Finished!
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 {};
}