![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
simple-sftp-uploader
Advanced tools
一个简单的 SFTP 上传器,把指定文件夹中的文件上传到服务器上。
可以单独用,也是个webpack
插件。
import SftpUploader from 'simple-sftp-uploader'
import fs from 'fs'
const sftpUploaderConfig = {
localDir: 'dist',
remoteDir: '/www/imba97.cn',
connect: {
host: '1.2.3.4',
port: 22,
username: 'root',
privateKey: fs.readFileSync('C:/Users/imba97/.ssh/id_rsa')
},
rmExclude: ['favicon.ico']
}
import SftpUploader from 'simple-sftp-uploader'
const sftpUploader = new SftpUploader(sftpUploaderConfig)
sftpUploader.start()
import SftpUploader from 'simple-sftp-uploader'
// ...
{
plugins: [new SftpUploader(sftpUploaderConfig)]
}
import SftpUploader from 'simple-sftp-uploader'
// ...
{
// ...
chainWebpack(config) {
// 添加插件
config
.plugin('SftpUploaderPlugin')
.use(SftpUploader)
.tap(() => [sftpUploaderConfig])
},
// ...
}
配置连接信息
const uploader = new Uploader({
connect: {
host: '1.2.3.4',
port: 22,
username: 'root',
privateKey: fs.readFileSync('C:/Users/imba97/.ssh/id_rsa')
}
})
开放的接口
// 连接,连接后才能执行以下操作
connect(): Promise<null>
// 上传文件
uploadFile(local: string, remote: string): Promise<null>
// 判断远程文件是否存在
exists(src: string): Promise<boolean>
// 删除文件夹内所有文件
deleteFiles(remote: string, exclude?: RegExp): Promise<null>
// 读取文件夹下的文件
readdir(src: string): Promise<string[]>
// 执行 shell 命令
exec(script: string): Promise<null>
// 创建文件夹
mkdir(dirPath: string): Promise<null>
// 关闭
close(): void
FAQs
用于将项目部署到服务器的 SFTP 上传器
The npm package simple-sftp-uploader receives a total of 2 weekly downloads. As such, simple-sftp-uploader popularity was classified as not popular.
We found that simple-sftp-uploader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.