mkdir-bluebird
promise wrapper for node’s fs.mkdir() that ignores EEXIST
by default.
wraps node’s fs.mkdir()
, in a bluebird promise that resolves with true
if successful or rejects with the Error
returned by fs.mkdir()
; both results need to be handled by the code calling this function.
table of contents
installation
npm install mkdir-bluebird
usage
mkdir( path[, mode][, ignore] )
@param string|buffer path@param number mode = 0o777@param boolean ignore = true ignore `EEXIST` directory errors returned by `fs.mkdir()`@returns Promise
default
ignores EEXIST
directory errors returned by fs.mkdir()
var mkdir = ; ;
false
set ignore to acknowledges EEXIST
directory errors returned by fs.mkdir()
var mkdir = ; ;
using node’s path module
the path __dirname/test
must exist in order to create the directory test-dir
in it
var mkdir = ;var path = ;var dirpath = path; ;