0.1.92 • Published 4 months ago

@itkyk/ftp-controller v0.1.92

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months ago

FTP Controller

How to use this module.

  1. Npm module install

    $ npm i -D @itkyk/ftp-controller
  2. Add scripts in package.json

        "script": {
          "ftp:init": "ftpController --init",
          "deploy:prev": "ftpController --deploy preview",
          "deploy:stg": "ftpController --deploy staging"
        }
  3. Run npm init command

        $ npm run ftp:init

    This command is added template file of .env.
    We recommend that you rewrite file name of that template.
    ex) .env.template.env.preview

  4. deploy

    1. CLI
      1. Run npm deploy command
            $ npm run deploy:prev
    2. API
      1. Import this module
        1. import deploy from "@itkyk/ftp-controller";
          deploy({
           key: "preview", // required
           list: false // not required. default is `false`.
          })
  5. finished

  • When complete, /ftp/ftp-upload.log will be output.

Options

optionvaluedescription
--init, -i-Create template file of .envfileThis option can't be used with other options.
--deploy, -d < value >stringFTP deploy option.You give extension of .env file.(ex) .env.preview → --deploy preview
--list, -lbooleanif true and when finish uploading, push log by console

Options of env

optionvaluedefault(指定しなかった場合)description
userString-FTP ID
passwordString-FTP pass word
hostString-FTP URL
portNumber-FTP access PORT
localRootString/dist/File upload destination path
remoteRootString/htdocs/Directory target to upload
includeArray"*", "**/*"Specify the file to upload. In the .env file, write as follows.include: "*, **/*"
excludeArray-Specify the file that will not be uploaded. In the .env file, write as follows.include: "*, **/*"
deleteRemoteBooleanfalseSpecifies whether to delete all existing files at the destination before uploading.
forcePasvBooleanfalseSpecifies whether passive mode enforces.
sftpBooleanfalseSpecifies whether to use SFTP.
privateKeystring-If you are using an SFTP connection and still need a pem key, enter the path to the pem key in this key.

使い方

  1. npmをインストール

    $ npm i -D @itkyk/ftp-controller
  2. package.jsonへスクリプトを追加

    "script": {
      "ftp:init": "ftpController --init",
      "deploy:prev": "ftpController --deploy preview",
      "deploy:stg": "ftpController --deploy staging"
    }
  1. 追加したinitコマンドを叩く
    $ npm run ftp:init
    プロジェクトのルートディレクトリに/ftp/.env.templateが作成されます。 この作られたテンプレートの.envファイルを編集して設定ファイルを作成。
    例) .env.template.env.preview
  1. deployする
    1. CLI
      1. deployコマンドを叩く
            $ npm run deploy:prev
    2. API
      1. importして使う 1.
        import deploy from "@itkyk/ftp-controller";
        deploy({
         key: "preview", // required
         list: false // not required. default is `false`.
        })
  2. 完了

    • 完了すると、/ftp/ftp-upload.logが出力されます。

Options

optionvaluedescription
--init, -i-.envファイルのテンプレート作成他optionとpの併用不可
--deploy, -d < value >StringFTPアップ時のコマンドです。.env後ろの拡張子をvalueとして与えてください。(ex) .env.preview → --deploy preview
--list, -lBooleantrueにするとFTPアップ時にconsoleにアップしたファイルが表示されます。

envファイル設定

optionvaluedefault(指定しなかった場合)description
userString-FTP ID
passwordString-FTP pass word
hostString-FTP URL
portNumber-FTP access PORT
localRootString/dist/ファイルアップ先のパス
remoteRootString/htdocs/アップ先のディレクトリターゲット
includeArray"*", "**/*"アップするファイルを指定。.envファイルでは以下のように記述してください。include: "*, **/*"
excludeArray-アップしないファイルを指定。.envファイルでは以下のように記述してください。include: "*, **/*"
deleteRemoteBooleanfalseアップロードする前に宛先にある既存のファイルをすべて削除するかどうか指定します。
forcePasvBooleanfalseパッシブモードが強制するかどうか指定します。
sftpBooleanfalseSFTPを使用するかどうか指定します。
privateKeystring-SFTP接続でなおかつpemキーが必要な場合、このキーにpemキーまでのパスを記入してください。
1.0.0-beta.0.5

4 months ago

1.0.0-beta.0.2

4 months ago

1.0.0-beta.0.3

4 months ago

1.0.0-beta.0.1

4 months ago

1.0.0-beta.0.4

4 months ago

0.1.92

10 months ago

0.1.91

1 year ago

0.1.9

1 year ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.0

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago