Comparing version 0.0.11 to 0.0.12
{ | ||
"name": "walkdir", | ||
"description": "Find files simply. Walks a directory tree emitting events based on what it finds. Presents a familiar callback/emitter/a+sync interface. Walk a tree of any depth.", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"author": "Ryan Day <soldair@gmail.com>", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
@@ -15,4 +15,4 @@ [![Build Status](https://secure.travis-ci.org/soldair/node-walkdir.png)](http://travis-ci.org/soldair/node-walkdir) | ||
walk('../',function(path,stat){ | ||
console.log('found: ',path); | ||
walk('../', function(path, stat) { | ||
console.log('found: ', path); | ||
}); | ||
@@ -24,3 +24,3 @@ | ||
emitter.on('file',function(filename,stat){ | ||
emitter.on('file', function(filename, stat) { | ||
console.log('file from emitter: ', filename); | ||
@@ -32,4 +32,4 @@ }); | ||
walk.sync('../',function(path,stat){ | ||
console.log('found sync:',path); | ||
walk.sync('../', function(path, stat) { | ||
console.log('found sync:', path); | ||
}); | ||
@@ -40,3 +40,3 @@ | ||
var paths = walk.sync('../'); | ||
console.log('found paths sync: ',paths); | ||
console.log('found paths sync: ', paths); | ||
@@ -63,5 +63,7 @@ ``` | ||
{ | ||
"follow_symlinks":false, // default is off | ||
"no_recurse":false, // only recurse one level deep | ||
"max_depth":undefined // only recurse down to max_depth. if you need more than no_recurse | ||
"follow_symlinks": false, // default is off | ||
"no_recurse": false, // only recurse one level deep | ||
"max_depth": undefined // only recurse down to max_depth. if you need more than no_recurse | ||
"track_inodes": true // on windows or with hardlinks some files are not emitted due to inode collision. | ||
// ^ should be used with max_depth to prevent infinite loop | ||
} | ||
@@ -74,4 +76,4 @@ ``` | ||
{ | ||
"return_object":false, // if true the sync return will be in {path:stat} format instead of [path,path,...] | ||
"no_return":false, // if true null will be returned and no array or object will be created with found paths. useful for large listings | ||
"return_object": false, // if true the sync return will be in {path:stat} format instead of [path,path,...] | ||
"no_return": false, // if true null will be returned and no array or object will be created with found paths. useful for large listings | ||
} | ||
@@ -84,3 +86,3 @@ ``` | ||
```js | ||
callback(path,stat) | ||
callback(path, stat) | ||
``` | ||
@@ -152,5 +154,5 @@ | ||
var p = require('path'); | ||
walk('/',function(path,stat){ | ||
walk('/', function(path, stat) { | ||
// ignore all .git directories. | ||
if(p.basename(path) === '.git') { | ||
if (p.basename(path) === '.git') { | ||
this.ignore(path) | ||
@@ -166,3 +168,3 @@ } | ||
var walk = require('walkdir'); | ||
walk('../',function(path,stat){ | ||
walk('../', function(path, stat) { | ||
this.end(); | ||
@@ -175,4 +177,4 @@ }); | ||
doSomethingAsync(function(){ | ||
emitter.end(); | ||
doSomethingAsync(function() { | ||
emitter.end(); | ||
}) | ||
@@ -179,0 +181,0 @@ ``` |
@@ -79,4 +79,6 @@ var EventEmitter = require('events').EventEmitter, | ||
var fileKey = stat.dev + '-' + stat.ino + '-' + fileName; | ||
if(inos[fileKey] && stat.ino) return; | ||
inos[fileKey] = 1; | ||
if(options.track_inodes !== false) { | ||
if(inos[fileKey] && stat.ino) return; | ||
inos[fileKey] = 1; | ||
} | ||
@@ -83,0 +85,0 @@ if (first && stat.isDirectory()) { |
Sorry, the diff of this file is not supported yet
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
27069
618
179