list-directory-contents
Implements ls -R
for Node.js.
Installation
$ npm install list-directory-contents
Usage
var ls = require('list-directory-contents');
ls('./', function (err, tree) {
[
'index.js',
'README',
'package.json',
'CONTRIBUTING.md',
'node_modules/',
'node_modules/lodash/',
'node_modules/async/',
'node_modules/fs-extra/',
'node_modules/fs-extra/index.js',
'node_modules/fs-extra/lib/',
'node_modules/fs-extra/node_modules/'
];
});
Why?
This module is merely a convenience-- @daaku did the hard work :)
It's just a thin wrapper for walker that presents a minimalist API. For EventEmitter usage (with built-in file vs. dir parsing), please use walker directly. See https://github.com/jprichardson/node-fs-extra/issues/63#issuecomment-49733873 for more info on motivations/goals.
License
MIT © Mike McNeil 2014