Comparing version 3.4.0 to 3.5.0
@@ -207,4 +207,5 @@ 'use strict'; | ||
if (stats && stats.isSymbolicLink()) { | ||
const full = entry.fullPath; | ||
try { | ||
const entryRealPath = await realpath(entry.fullPath); | ||
const entryRealPath = await realpath(full); | ||
const entryRealPathStats = await lstat(entryRealPath); | ||
@@ -215,2 +216,8 @@ if (entryRealPathStats.isFile()) { | ||
if (entryRealPathStats.isDirectory()) { | ||
const len = entryRealPath.length; | ||
if (full.startsWith(entryRealPath) && full.substr(len, 1) === sysPath.sep) { | ||
return this._onError(new Error( | ||
`Circular symlink detected: "${full}" points to "${entryRealPath}"` | ||
)); | ||
} | ||
return 'directory'; | ||
@@ -217,0 +224,0 @@ } |
{ | ||
"name": "readdirp", | ||
"description": "Recursive version of fs.readdir with streaming API.", | ||
"version": "3.4.0", | ||
"version": "3.5.0", | ||
"homepage": "https://github.com/paulmillr/readdirp", | ||
@@ -48,10 +48,11 @@ "repository": { | ||
"devDependencies": { | ||
"@types/node": "^13", | ||
"@types/node": "^14", | ||
"chai": "^4.2", | ||
"chai-subset": "^1.6", | ||
"dtslint": "^3.3.0", | ||
"eslint": "^6.6.0", | ||
"eslint": "^7.0.0", | ||
"mocha": "^7.1.1", | ||
"nyc": "^15.0.0", | ||
"rimraf": "^3.0.0" | ||
"rimraf": "^3.0.0", | ||
"typescript": "^4.0.3" | ||
}, | ||
@@ -58,0 +59,0 @@ "nyc": { |
# readdirp [![Weekly downloads](https://img.shields.io/npm/dw/readdirp.svg)](https://github.com/paulmillr/readdirp) | ||
> Recursive version of [fs.readdir](https://nodejs.org/api/fs.html#fs_fs_readdir_path_options_callback). Exposes a **stream API** and a **promise API**. | ||
Recursive version of [fs.readdir](https://nodejs.org/api/fs.html#fs_fs_readdir_path_options_callback). Exposes a **stream API** and a **promise API**. | ||
[![NPM](https://nodei.co/npm/readdirp.png)](https://www.npmjs.com/package/readdirp) | ||
@@ -82,3 +81,3 @@ ```sh | ||
- `type: 'files'`: determines if data events on the stream should be emitted for `'files'` (default), `'directories'`, `'files_directories'`, or `'all'`. Setting to `'all'` will also include entries for other types of file descriptors like character devices, unix sockets and named pipes. | ||
- `alwaysStat: false`: always return `stats` property for every file. Setting it to `true` can double readdir execution time - use it only when you need file `size`, `mtime` etc. Cannot be enabled on node <10.10.0. | ||
- `alwaysStat: false`: always return `stats` property for every file. Default is `false`, readdirp will return `Dirent` entries. Setting it to `true` can double readdir execution time - use it only when you need file `size`, `mtime` etc. Cannot be enabled on node <10.10.0. | ||
- `lstat: false`: include symlink entries in the stream along with files. When `true`, `fs.lstat` would be used instead of `fs.stat` | ||
@@ -98,2 +97,5 @@ | ||
- 3.5 (Oct 13, 2020) disallows recursive directory-based symlinks. | ||
Before, it could have entered infinite loop. | ||
- 3.4 (Mar 19, 2020) adds support for directory-based symlinks. | ||
- 3.3 (Dec 6, 2019) stabilizes RAM consumption and enables perf management with `highWaterMark` option. Fixes race conditions related to `for-await` looping. | ||
@@ -100,0 +102,0 @@ - 3.2 (Oct 14, 2019) improves performance by 250% and makes streams implementation more idiomatic. |
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
20118
285
123
9