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

dirscanner

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dirscanner - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

test/directory.test.js

2

dirscanner.js

@@ -23,4 +23,2 @@ //

var Dirscanner = function Dirscanner(target, ignore) {
target = path.normalize(path.join(process.cwd(), target));
emitter.call(this);

@@ -27,0 +25,0 @@ this._target = target; // Source path

@@ -69,3 +69,4 @@ //

if (err) {
this.emit('error', err);
// @TODO: Set error handler instead of keeping reference to ds?
if (this._ds) this._ds.error(err);
return;

@@ -112,10 +113,13 @@ }

// Ignore this file?
var ignore = this._ds._ignore;
for (var i = 0; i < ignore.length; i++) {
var pattern = ignore[i];
var base = path.basename(target);
if (base.match(pattern)) {
this.emit('ignore', target);
this.popPath();
return;
// @TODO: Shift this property down to directory objects.
if (this._ds) {
var ignore = this._ds._ignore || [];
for (var i = 0; i < ignore.length; i++) {
var pattern = ignore[i];
var base = path.basename(target);
if (base.match(pattern)) {
this.emit('ignore', target);
this.popPath();
return;
}
}

@@ -122,0 +126,0 @@ }

@@ -23,3 +23,3 @@ //

File.prototype.readStream = function() {
return fs.createReadStream(this._path);
return fs.createReadStream(this.path);
};

@@ -26,0 +26,0 @@

{
"name": "dirscanner",
"version": "0.0.1",
"version": "0.0.2",
"description": "Analyze a directory substructure and return it as an object.",

@@ -5,0 +5,0 @@ "main": "dirscanner.js",

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