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

findit

Package Overview
Dependencies
Maintainers
0
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

findit - npm Package Compare versions

Comparing version 0.0.5 to 0.1.0

25

index.js

@@ -26,8 +26,3 @@ var fs = require('fs');

if (cb) cb(file, stat);
em.emit('path', file, stat);
if (stat.isSymbolicLink()) {
em.emit('link', file, stat);
}
if (inodes[stat.ino]) {

@@ -37,12 +32,16 @@ // already seen this inode, probably a recursive symlink

}
else if (stat.isDirectory()) {
em.emit('directory', file, stat);
finder(file, this);
}
else {
em.emit('file', file, stat);
this(null);
em.emit('path', file, stat);
if (stat.isDirectory()) {
em.emit('directory', file, stat);
finder(file, this);
}
else {
em.emit('file', file, stat);
this(null);
}
inodes[stat.ino] = true;
}
inodes[stat.ino] = true;
})

@@ -49,0 +48,0 @@ .seq(f.bind({}, null))

{
"name" : "findit",
"version" : "0.0.5",
"version" : "0.1.0",
"description" : "Walk a directory tree.",

@@ -5,0 +5,0 @@ "main" : "./index.js",

var assert = require('assert');
var findit = require('findit');
var findit = require('../');
var Hash = require('hashish');

@@ -7,14 +7,14 @@

var find = findit.find(__dirname + '/cycle');
var found = { directory : [], link : [], file : [] };
var found = { directory : [], file : [], path : [] };
find.on('directory', function (dir, stat) {
find.on('directory', function (dir) {
found.directory.push(dir);
});
find.on('link', function () {
found.link.push(dir);
find.on('file', function (file) {
found.file.push(file);
});
find.on('file', function (file) {
found.file.push(dir);
find.on('path', function (file) {
found.path.push(file);
});

@@ -30,4 +30,4 @@

directory : [ 'meep', 'meep/moop' ],
link : [ 'meep/moop' ],
file : []
file : [],
path : [ 'meep', 'meep/moop' ]
}, function (x) {

@@ -40,3 +40,5 @@ return x.map(function (dir) {

assert.deepEqual(dirs.directory, found.directory);
assert.deepEqual(dirs.file, found.file);
assert.deepEqual(dirs.path, found.path);
});
};

Sorry, the diff of this file is not supported yet

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