文件上传

Install
yarn add node-upload-util
# or
yarn add global node-upload-util
Usage

import { run } from 'node-upload-util';
run({
ftp: {
host: '1.1.1.1',
port: 21,
user: 'username',
password: '123456',
files: ['file.txt', 'dir'],
rootPath: '/',
destRootPath: '/home/ftp'
},
sftp: {
host: '1.1.1.1',
port: 22,
user: 'username',
password: '123456',
files: ['file.txt', 'dir'],
rootPath: '/',
destRootPath: '/home/sftp'
},
})
Dev
# clone code
git clone https://github.com/hangboss1761/upload-util
cd upload-util
# install dependencies
yarn
# start dev mode
yarn dev
# build for production
yarn build
npm link
upload start
Test
yarn test
# or
yarn test:cover