Skip to content

syln/node-ftp-lite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-ftp-lite

a wrapeer for the node-ftp-client and node-ftp

Install

npm install ftp-lite

Usage

create a new ftp.conf.json in your root dir, it should be like this:

{
    "host":"your ftp host",
    "user":"username",
    "port":21, //default port
    "source":"source", //support file or directories as 'abc.txt' or 'dir/**'.
    "remote":"Directory/", //remote path.
    "baseDir":"ftp-test"  //the base-dir of remote dir,if your remote directory have sub dir.
}

then add option in your package.json:

"scripts": {
    "push":" your compile task && ftplite " //upload files automatically after compiling.
  },

用法

在项目根目录创建ftp.conf.json:

{
    "host":"your ftp host",   //服务器地址
    "user":"username", //用户名
    "port":21, //默认端口
    "source":"source", //可以上传目录或文件
    "remote":"Directory/", // 服务器中的目录
    "baseDir":"ftp-test"  //如果上传到嵌套目录中,需要设置相应目录
}

package.json中脚本配置相应的动作

"scripts": {
    "push":" your compile task && ftplite " //主要用于前端项目打包后自动上传到ftp服务器
  },

About

a wrapper for node-ftp-client and node-ftp(only upload)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published