Recursively create nested directories with jsftp, like mkdirp
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.editorconfig
.gitattributes
.gitignore
.travis.yml
index.js
license
package.json
readme.md
test.js

readme.md

jsftp-mkdirp Build Status

Recursively create nested directories with jsftp, like mkdirp

FTP can natively create only one directory at the time.

Useful for being able to upload files to deep paths without knowing if the directories exists beforehand.

Install

$ npm install --save jsftp-mkdirp

Usage

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';

ftp.mkdirp(path).then(() => {
	console.log('Created path:', path);
});

API

JSFtp.mkdirp(path)

Returns a Promise.

path

Type: string

Path of the nested directories you want to create.

License

MIT © Sindre Sorhus