mkpath
Make all directories in a path, like mkdir -p
Last updated 14 years ago by jrajav .
MIT · Repository · Original npm · Tarball · package.json
$ npm 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 (11 years ago)

2 Versions

  • 1.0.0                                ...           11 years ago
  • 0.1.0                                ...           14 years ago
Maintainers (1)
Downloads
Total 13
Today 0
This Week 0
This Month 9
Last Day 0
Last Week 5
Last Month 1
Dependencies (0)
None
Dev Dependencies (1)
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE