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

findup-sync

Package Overview
Dependencies
Maintainers
3
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

findup-sync - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

24

index.js

@@ -11,3 +11,3 @@ 'use strict';

var resolveDir = require('resolve-dir');
var exists = require('fs-exists-sync');
var detect = require('detect-file');
var mm = require('micromatch');

@@ -50,3 +50,3 @@

} else {
return findFile(cwd, pattern);
return findFile(cwd, pattern, options);
}

@@ -57,3 +57,3 @@ }

var isMatch = mm.matcher(pattern, opts);
var files = fs.readdirSync(cwd);
var files = tryReaddirSync(cwd);
var len = files.length;

@@ -77,6 +77,7 @@ var idx = -1;

function findFile(cwd, filename) {
function findFile(cwd, filename, options) {
var res;
var fp = cwd ? path.resolve(cwd, filename) : filename;
if (exists(fp)) {
return fp;
if (res = detect(fp, options)) {
return res;
}

@@ -90,4 +91,4 @@

fp = path.resolve(cwd, filename);
if (exists(fp)) {
return fp;
if (res = detect(fp, options)) {
return res;
}

@@ -97,1 +98,8 @@ }

}
function tryReaddirSync(fp) {
try {
return fs.readdirSync(fp);
} catch(err) {}
return [];
}
{
"name": "findup-sync",
"description": "Find the first file matching a given pattern in the current directory or the nearest ancestor directory.",
"version": "0.4.1",
"version": "0.4.2",
"homepage": "https://github.com/cowboy/node-findup-sync",

@@ -23,3 +23,3 @@ "author": "\"Cowboy\" Ben Alman (http://benalman.com)",

"dependencies": {
"fs-exists-sync": "^0.1.0",
"detect-file": "^0.1.0",
"is-glob": "^2.0.1",

@@ -30,2 +30,3 @@ "micromatch": "^2.3.7",

"devDependencies": {
"fs-exists-sync": "^0.1.0",
"grunt": "^1.0.1",

@@ -32,0 +33,0 @@ "grunt-contrib-jshint": "^0.12.0",

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