list-directory-contents
Advanced tools
Comparing version 0.0.2 to 0.0.3
11
index.js
@@ -22,8 +22,17 @@ /** | ||
walker(dir) | ||
.on('entry', function (entry, stat) { | ||
.on('dir', function (entry, stat) { | ||
// Don't include top-level directory (`dir`) in result `tree` | ||
if (entry===dir) return; | ||
// End users should be able to do: | ||
// somepath.match(/^[^.] | ||
entry = entry.replace(/\/*$/, '/'); | ||
results.push(entry); | ||
}) | ||
.on('file', function (entry, stat) { | ||
// Don't include top-level directory (`dir`) in result `tree` | ||
if (entry===dir) return; | ||
results.push(entry); | ||
}) | ||
.on('error', function (err){ | ||
@@ -30,0 +39,0 @@ if (spinlock) return; |
{ | ||
"name": "list-directory-contents", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Get the contents of a directory recursively (like ls -R)", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -45,5 +45,5 @@ # list-directory-contents | ||
This module is merely a convenience-- @daaku did the hard work :) | ||
This module is merely a convenience; a thin wrapper for [walker](https://github.com/daaku/nodejs-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 :) | ||
It's just a thin wrapper for [walker](https://github.com/daaku/nodejs-walker) that presents a minimalist API. For EventEmitter usage (with built-in file vs. dir parsing), please use [walker](https://github.com/daaku/nodejs-walker) directly. See https://github.com/jprichardson/node-fs-extra/issues/63#issuecomment-49733873 for more info on motivations/goals. | ||
For more advanced use cases like built-in file vs. dir parsing, fetching `lstat` metadata, or controlling the universe mind bullets, please use [walker](https://github.com/daaku/nodejs-walker) directly. See https://github.com/jprichardson/node-fs-extra/issues/63#issuecomment-49733873 for ergaleígony. | ||
@@ -50,0 +50,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
3265
5
38
0