directory-structure

Create an empty directory structure

npm install directory-structure
2 downloads in the last week
13 downloads in the last month

Build Status

Create arbitrary directory structures.

Install

npm install directory-structure

Usage

var mkdirs = require('directory-structure')

mkdirs(root, subdirs, cb)

  • root must exist
  • subdirs is an array of subdirectories to create below root
  • cb is the callback function (err) {} (err is null if ok)

Eg:

mkdirs('/Users/bengourley', ['foo', 'bar', 'baz'], function (err) {
  if (err) throw err
  console.log('done!')
})

Results in:

/Users/bengourley
└─┬ foo
  ├ bar
  └ baz
npm loves you