list-directory-contents
Get the contents of a directory recursively (like ls -R)
Last updated 12 years ago by balderdashy .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install list-directory-contents 
SYNC missed versions from official npm registry.

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) {
  
  // NOTE:
  // everything ending in `/` in the output below is a path to a directory
  // all other paths are to files
  
  
  // `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; a thin wrapper for walker. It presents a minimalist API for the most basic task you're likely to get up to: getting all the things in a directory, all the things in those things, and so forth. @daaku did all the hard work :)

For more advanced use cases like built-in file vs. dir parsing, fetching lstat metadata, or controlling the universe mind bullets, please use walker directly. See https://github.com/jprichardson/node-fs-extra/issues/63#issuecomment-49733873 for ergaleígony.

License

MIT © Mike McNeil 2014

Current Tags

  • 0.0.3                                ...           latest (12 years ago)

3 Versions

  • 0.0.3                                ...           12 years ago
  • 0.0.2                                ...           12 years ago
  • 0.0.1                                ...           12 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 1
Dependencies (1)
Dev Dependencies (2)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |