Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

list-directory-contents

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

list-directory-contents

Get the contents of a directory recursively (like ls -R)

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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-- @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

Keywords

FAQs

Package last updated on 23 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc