Awesome 社區模塊

@fibjs/mkdirp

NPM version build status appveyor build status Test coverage David deps Known Vulnerabilities npm download

Likemkdir -p

Install

1
$ npm i @fibjs/mkdirp --save

Usage

1 2 3 4 5 6 7 8
const mkdirp = require('@fibjs/mkdirp'); try{ mkdirp('/tmp/a/c/d') } catch(err) { console.error(err) }

then /tmp/a/c/d has beed created.

API

  • mkdirp(dir, opts)

asynchronously create a new directory and any necessary subdirectories atdiropts.modeoptsopts.mode

Ifopts.mode0777 & (~process.umask())

Returns the first directory that had to be created, if any.

You can optionally pass in an alternatefsopts.fsopts.fs.mkdir(path, mode)opts.fs.stat(path)

Questions & Suggestions

Please open an issue

License

MIT