node-upload-util
v0.0.1
Published
A node upload util, Support ftp and sftp
Downloads
2
Readme
文件上传
Install
yarn add node-upload-util
# or
yarn add global node-upload-util
Usage
- Use in cli
- Import in your code
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
- cli
npm link
upload start
Test
yarn test
# or
yarn test:cover