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

readdirp

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

readdirp - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

2

package.json

@@ -5,3 +5,3 @@ {

"description": "Recursive version of fs.readdir with streaming api.",
"version": "1.2.0",
"version": "1.3.0",
"homepage": "https://github.com/thlorenz/readdirp",

@@ -8,0 +8,0 @@ "repository": {

@@ -216,4 +216,4 @@ 'use strict';

subdirs.forEach(function (di) {
if(opts.entryType === 'directories' || opts.entryType === 'both') {
subdirs.forEach(function (di) {
if(opts.entryType === 'directories' || opts.entryType === 'both' || opts.entryType === 'all') {
fileProcessed(di);

@@ -226,6 +226,8 @@ }

.filter(function(ei) {
return (ei.stat.isFile() || ei.stat.isSymbolicLink()) && opts.fileFilter(ei);
var isCorrectType = opts.entryType === 'all' ?
!ei.stat.isDirectory() : ei.stat.isFile() || ei.stat.isSymbolicLink();
return isCorrectType && opts.fileFilter(ei);
})
.forEach(function (fi) {
if(opts.entryType === 'files' || opts.entryType === 'both'){
.forEach(function (fi) {
if(opts.entryType === 'files' || opts.entryType === 'both' || opts.entryType === 'all') {
fileProcessed(fi);

@@ -232,0 +234,0 @@ }

@@ -86,5 +86,5 @@ # readdirp [![Build Status](https://secure.travis-ci.org/thlorenz/readdirp.png)](http://travis-ci.org/thlorenz/readdirp)

- **entryType**: determines if data events on the stream should be emitted for `'files'`, `'directories'` or `'both'`. Defaults to `'files'`.
- **entryType**: determines if data events on the stream should be emitted for `'files'`, `'directories'`, `'both'`, or `'all'`. Setting to `'all'` will also include entries for other types of file descriptors like character devices, unix sockets and named pipes. Defaults to `'files'`.
- **lstat**: if `true`, readdirp uses `fs.lstat` instead of `fs.stat` in order to stat files
- **lstat**: if `true`, readdirp uses `fs.lstat` instead of `fs.stat` in order to stat files and includes symlink entries in the stream along with files.

@@ -91,0 +91,0 @@ ## entry info

@@ -7,2 +7,3 @@ /*jshint asi:true */

, util = require('util')
, net = require('net')
, readdirp = require('../readdirp.js')

@@ -90,2 +91,16 @@ , root = path.join(__dirname, '../test/bed')

test('\nreading non-standard fds', function (t) {
t.plan(2);
var server = net.createServer().listen(path.join(root, 'test.sock'), function(){
readdirp(opts({ entryType: 'all' }), function (err, res) {
t.equals(res.files.length, totalFiles + 1, 'all files + socket');
readdirp(opts({ entryType: 'both' }), function (err, res) {
t.equals(res.files.length, totalFiles, 'all regular files only');
server.close();
t.end();
})
})
});
})
test('\nreading root using glob filter', function (t) {

@@ -92,0 +107,0 @@ // normal

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