Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lyftp

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lyftp - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

3

core.js

@@ -82,3 +82,3 @@ let path = require('path')

putFile(localP, remoteP){
console.log('路径', localP, remoteP);
console.log(`路径 ${localP} ---> ${remoteP}`);
// 文件名所在文件夹

@@ -91,2 +91,3 @@ let REMOTE_PATH = remoteP.slice(0, remoteP.lastIndexOf('/'))

this.ftp.put(localP, remoteP, (err)=>{
console.log('文件上传完成')
if(err){

@@ -93,0 +94,0 @@ console.log(err);

@@ -42,2 +42,38 @@ #!/usr/bin/env node

// 上传文件
function upload(list, config){
let ftp = new FTP()
let lftp = new LFTP(ftp, configPath)
// 远程文件夹
let {remotePath} = config
remotePath = `/${remotePath}/`
ftp.on('ready', () => {
Promise.all(list.map(localPath => {
localPath = path.resolve(configPath, localPath)
return lftp.put(localPath, remotePath)
})).then(msg => {
console.log('上传完毕!')
process.exit()
})
})
// 连接时间
config.connTimeout = 1000
config.pasvTimeout = 1000
config.keepalive = 1000
ftp.on('err', err=>{
console.log('ftp上传出错', err)
})
ftp.on('end', msg=>{
console.log('ftp连接中断', msg)
})
ftp.connect(config)
}
const KEY = args[0]

@@ -50,10 +86,6 @@

return
} else if(KEY == '--arr') {
return upload(args.slice(1), config)
}
let ftp = new FTP()
let lftp = new LFTP(ftp, configPath)
let {remotePath} = config
remotePath = `/${remotePath}/`
// 上传默认路径的文件

@@ -63,23 +95,7 @@ if (KEY == 'upload') {

let list = config.upload.default
upload(list)
upload(list, config)
} else {
let list = config.upload[KEY]
upload(list)
upload(list, config)
}
function upload(list){
ftp.on('ready', () => {
Promise.all(list.map(localPath => {
localPath = path.resolve(configPath, localPath)
return lftp.put(localPath, remotePath)
})).then(msg => {
console.log('上传完毕!')
process.exit()
})
})
}
config.keepalive = 1000000000
ftp.connect(config)
{
"name": "lyftp",
"version": "1.0.7",
"version": "1.0.8",
"description": "lyftp is ftp package, you can upload an entire folder or a file",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc