【文件属性】:
文件名称:jsftp-mkdirp:用jsftp递归创建嵌套目录,例如mkdirp
文件大小:5KB
文件格式:ZIP
更新时间:2021-05-26 08:02:03
JavaScript
jsftp-mkdirp
用递归创建嵌套目录,例如
FTP一次只能在本地创建一个目录。
能够在不事先知道目录是否存在的情况下将文件上传到深层路径很有用。
安装
$ npm install jsftp-mkdirp
用法
const JSFtp = require ( 'jsftp' ) ;
// Decorate `JSFtp` with a new method `mkdirp`
require ( 'jsftp-mkdirp' ) ( JSFtp ) ;
const ftp = new JSFtp ( {
host : 'myserver.com'
} ) ;
const path = 'public_html/deploy/foo/bar' ;
( async ( ) => {
await ftp . mkdirp ( path ) ;
console . log (
【文件预览】:
jsftp-mkdirp-main
----.gitattributes(29B)
----.github()
--------workflows()
----test.js(1KB)
----license(1KB)
----.npmrc(19B)
----.editorconfig(175B)
----.gitignore(23B)
----index.js(1KB)
----readme.md(876B)
----package.json(917B)