Home

Awesome

export-dirs NPM version

Export directories and their files as node.js modules.

Install with npm

npm i export-dirs --save

Usage

var dirs = require('export-dirs');

Example output

When used in combination with export-files, the files and directories in fixtures result in:

// all files and directories are flattened onto the `_` object
{ _:
   { z: [Function],
     y: [Function],
     x: [Function],
     f: [Function],
     e: [Function],
     d: [Function],
     i: [Function],
     h: [Function],
     g: [Function],
     c: [Function],
     b: [Function],
     a: [Function] },
  // files in the same directory as export-dirs
  z: [Function],
  y: [Function],
  x: [Function],
  // folders in the same directory as export-dirs
  two: { f: [Function], e: [Function], d: [Function] },
  three: { i: [Function], h: [Function], g: [Function] },
  one: { c: [Function], b: [Function], a: [Function] } }

(Note that export-dirs does not recurse).

Related projects

Running tests

Install dev dependencies.

npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright (c) 2015 Jon Schlinkert
Released under the MIT license


This file was generated by verb-cli on March 18, 2015.