Skip to content

DataV-Team/FTP

Repository files navigation

ENGLISH

FTP

LICENSE LICENSE

基于 FTP 封装的 Promisify FTP

npm 安装

$ npm install @jiaminghi/ftp

使用

import { put, mkDir } from '@jiaminghi/ftp'

// do something

示例

put

type put = (ftp: Client, src: string, dest: string) => Promise<boolean>

rmDir

type rmDir = (ftp: Client, src: string, recusive = true) => Promise<boolean>

mkDir

type mkDir = (ftp: Client, src: string, recusive = true) => Promise<boolean>

getList

type getList = (ftp: Client, src: string) => Promise<Client.ListingElement[] | false>

emptyDir

type emptyDir = (ftp: Client, src: string, except: string[] = []) => Promise<boolean>

deleteFile

type deleteFile = (ftp: Client, src: string) => Promise<boolean>