@xinliang/scp
Encapsulated node-scp, uploading files to the server is more convenient.
0. install
npm i @xinliang/scp -D
scp.config.json
file
1. init The clientConfig configuration should be consistent with node-scp. If you expect more freedom of control, you should use node-scp directly
{
"clientConfig": {
"host": "www.google.com",
"port": 22,
"username": "root"
},
"uploadPath": "./dist",
"remotePath": "project/workspace"
}
scripts
for package.json
2. add ...
"scripts": {
+ "push": "scp",
},
...