@fibjs/mkdirp
Recursively mkdir, like `mkdir -p`
Last updated 2 years ago by ngot .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @fibjs/mkdirp 
SYNC missed versions from official npm registry.

@fibjs/mkdirp

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

Like mkdir -p, but in fibjs!

Install

$ npm i @fibjs/mkdirp --save

Usage

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 at dir with octal permission string opts.mode. If opts is a non-object, it will be treated as the opts.mode.

If opts.mode isn't specified, it defaults to 0777 & (~process.umask()).

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

You can optionally pass in an alternate fs implementation by passing in opts.fs. Your implementation should have opts.fs.mkdir(path, mode) and opts.fs.stat(path).

Questions & Suggestions

Please open an issue here.

License

MIT

Current Tags

  • 1.0.1                                ...           latest (2 years ago)

2 Versions

  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 5
Last Day 0
Last Week 0
Last Month 2
Dependencies (0)
None
Dev Dependencies (1)

Copyright 2014 - 2017 © taobao.org |