mkpath
Make all directories in a path, like mkdir -p
Last updated 5 years ago by jrajav .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install mkpath 
SYNC missed versions from official npm registry.

mkpath

Make all directories in a path, like mkdir -p.

How to use

var mkpath = require('mkpath');

mkpath('red/green/violet', function (err) {
    if (err) throw err;
    console.log('Directory structure red/green/violet created');
});

mkpath.sync('/tmp/blue/orange', 0700);

mkpath(path, [mode = 0777 & (~process.umask()),] [callback])

Create all directories that don't exist in path with permissions mode. When finished, callback(err) fires with the error, if any.

mkpath.sync(path, [mode = 0777 & (~process.umask())]);

Synchronous version of the same. Throws error, if any.

License

This software is released under the MIT license.

Current Tags

  • 1.0.0                                ...           latest (5 years ago)

2 Versions

  • 1.0.0                                ...           5 years ago
  • 0.1.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 570
This Week 11,498
This Month 18,544
Last Day 782
Last Week 10,963
Last Month 47,703
Dependencies (0)
None
Dev Dependencies (1)
Dependents (293)

Copyright 2014 - 2016 © taobao.org |