recursive-search
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -19,3 +19,3 @@ // Generated by CoffeeScript 1.6.3 | ||
next = (function() { | ||
var file, stat; | ||
var condition, file, stat; | ||
file = list[i++]; | ||
@@ -31,3 +31,4 @@ if (!file) { | ||
} else { | ||
if (path.basename(file) === filename) { | ||
condition = (filename.constructor.name === "RegExp" ? path.basename(file).match(filename) : path.basename(file) === filename); | ||
if (condition) { | ||
matches.push(file); | ||
@@ -48,6 +49,8 @@ } | ||
return dive(dir, function(err, file) { | ||
var condition; | ||
if (err) { | ||
return callback(err); | ||
} | ||
if (path.basename(file) === filename) { | ||
condition = (filename.constructor.name === "RegExp" ? path.basename(file).match(filename) : path.basename(file) === filename); | ||
if (condition) { | ||
results.push(file); | ||
@@ -54,0 +57,0 @@ return callback(null, file); |
{ | ||
"name": "recursive-search", | ||
"author": "Thibault Charbonnier <thibaultcha@me.com>", | ||
"version": "0.0.1", | ||
"contributors": [ | ||
"woutervroege" | ||
], | ||
"version": "0.0.2", | ||
"description": "Recursively search a file in given directory", | ||
@@ -6,0 +9,0 @@ "keywords": [ |
@@ -31,2 +31,5 @@ # node-recursive-search | ||
}) | ||
// regex support in both functions | ||
results = search.recursiveSearchSync(/.txt$/, __dirname + '/dir') | ||
``` | ||
@@ -33,0 +36,0 @@ |
Sorry, the diff of this file is not supported yet
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
9763
1651
111
44