项目作者: wangzhiguoengineer

项目描述 :
Upload project file to FTP site
高级语言: TypeScript
项目地址: git://github.com/wangzhiguoengineer/site-ftp.git
创建时间: 2020-03-07T20:34:08Z
项目社区:https://github.com/wangzhiguoengineer/site-ftp

开源协议:

下载


Instructions

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

    Install

    1. npm install site-ftp --save-dev
  • create a file ftp.js
    1. const { SiteFtp } = require('site-ftp');
    2. SiteFtp.connect({
    3. "host": "localhost",
    4. "port": 21,
    5. "username": "anonymous",
    6. "password": "anonymous@",
    7. "type": "ftp",
    8. "from": ["dist/**"],
    9. "to": "/public_html/",
    10. "rm": true
    11. });
  • run node
    1. node ftp.js
  • console √ Finished!
    1. i {"host":"","port":21,"username":"","password":"","type":"ftp","from":["dist/**","src"],"to":"/public_html/","rm":true}
    2. i Connecting...
    3. i Deleting the ftp folder`/public_html/`
    4. Successfully deleted the ftp folder`/public_html/`
    5. i Uploading...
    6. Finished!

    Default Options

    1. {
    2. "host": "localhost",
    3. "port": 21,
    4. "username": "anonymous",
    5. "password": "anonymous@",
    6. "type": "ftp",
    7. "from": ["dist/**"],
    8. "to": "/public_html/",
    9. "rm": true
    10. }

    TypeScript Options

    1. export declare namespace SiteFtp {
    2. interface SiteFtpOptions {
    3. host?: string;
    4. port?: number;
    5. username?: string;
    6. password?: string;
    7. type?: string;
    8. from?: Array<string>;
    9. to?: string;
    10. rm?: boolean | string;
    11. }
    12. export function connect(options: SiteFtpOptions): void;
    13. export {};
    14. }