All files / src/fs-ambi mkdir.js

0% Statements 0/6
0% Branches 0/4
0% Functions 0/3
0% Lines 0/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16                               
import FS from 'fs'
 
 
export default function mkdir(path, options) {
	let { async, ...fsOpts } = options
 
	if (async)
		return new Promise(
			(resolve, reject) => FS.mkdir(path, fsOpts, (error) => error ? reject(error) : resolve())
		)
 
	else
		return FS.mkdirSync(path, fsOpts)
 
}