find-file-up
Advanced tools
Comparing version 0.1.3 to 1.0.1
19
index.js
/*! | ||
* find-pkg <https://github.com/jonschlinkert/find-pkg> | ||
* find-file-up <https://github.com/jonschlinkert/find-file-up> | ||
* | ||
* Copyright (c) 2015, Jon Schlinkert. | ||
* Licensed under the MIT License. | ||
* Copyright (c) 2015, 2017, Jon Schlinkert. | ||
* Released under the MIT License. | ||
*/ | ||
@@ -10,10 +10,5 @@ | ||
/** | ||
* Module dependencies | ||
*/ | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var resolve = require('resolve-dir'); | ||
var existsSync = require('fs-exists-sync'); | ||
@@ -66,3 +61,3 @@ /** | ||
if (existsSync(fp)) { | ||
if (fs.existsSync(fp)) { | ||
return path.resolve(fp); | ||
@@ -77,3 +72,3 @@ } | ||
var filepath = path.resolve(dir, filename); | ||
if (existsSync(filepath)) { | ||
if (fs.existsSync(filepath)) { | ||
return filepath; | ||
@@ -89,3 +84,3 @@ } | ||
/** | ||
* Returns true if a file exists. `fs.exists` and `fs.existsSync` are deprecated. | ||
* Returns true if a file exists, since `fs.exists` is deprecated. | ||
* See: https://nodejs.org/api/fs.html#fs_fs_exists_path_callback | ||
@@ -95,3 +90,3 @@ */ | ||
function exists(filepath, cb) { | ||
(fs.access || fs.stat)(filepath, function(err) { | ||
fs.stat(filepath, function(err) { | ||
if (err && err.code === 'ENOENT') { | ||
@@ -98,0 +93,0 @@ cb(false); |
{ | ||
"name": "find-file-up", | ||
"description": "Find a file, starting with the given cwd and recursively searching up one directory until it's found (or we run out of directories). Async and sync.", | ||
"version": "0.1.3", | ||
"version": "1.0.1", | ||
"homepage": "https://github.com/jonschlinkert/find-file-up", | ||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"contributors": [ | ||
"Jon Schlinkert (http://twitter.com/jonschlinkert)", | ||
"pointnet (https://github.com/pointnet)" | ||
], | ||
"repository": "jonschlinkert/find-file-up", | ||
@@ -13,5 +17,3 @@ "bugs": { | ||
"files": [ | ||
"index.js", | ||
"LICENSE", | ||
"README.md" | ||
"index.js" | ||
], | ||
@@ -26,9 +28,8 @@ "main": "index.js", | ||
"dependencies": { | ||
"fs-exists-sync": "^0.1.0", | ||
"resolve-dir": "^0.1.0" | ||
"resolve-dir": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"delete": "^0.3.2", | ||
"gulp-format-md": "^0.1.9", | ||
"mocha": "^2.5.3" | ||
"delete": "^1.0.1", | ||
"gulp-format-md": "^0.1.12", | ||
"mocha": "^3.4.1" | ||
}, | ||
@@ -35,0 +36,0 @@ "keywords": [ |
@@ -1,4 +0,4 @@ | ||
# find-file-up [![NPM version](https://img.shields.io/npm/v/find-file-up.svg?style=flat)](https://www.npmjs.com/package/find-file-up) [![NPM downloads](https://img.shields.io/npm/dm/find-file-up.svg?style=flat)](https://npmjs.org/package/find-file-up) [![Build Status](https://img.shields.io/travis/jonschlinkert/find-file-up.svg?style=flat)](https://travis-ci.org/jonschlinkert/find-file-up) | ||
# find-file-up [![NPM version](https://img.shields.io/npm/v/find-file-up.svg?style=flat)](https://www.npmjs.com/package/find-file-up) [![NPM monthly downloads](https://img.shields.io/npm/dm/find-file-up.svg?style=flat)](https://npmjs.org/package/find-file-up) [![NPM total downloads](https://img.shields.io/npm/dt/find-file-up.svg?style=flat)](https://npmjs.org/package/find-file-up) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/find-file-up.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/find-file-up) | ||
Find a file, starting with the given cwd and recursively searching up one directory until it's found (or we run out of directories). Async and sync. | ||
> Find a file, starting with the given cwd and recursively searching up one directory until it's found (or we run out of directories). Async and sync. | ||
@@ -19,3 +19,3 @@ ## Install | ||
**async** | ||
### async | ||
@@ -34,3 +34,3 @@ ```js | ||
**sync** | ||
### sync | ||
@@ -56,10 +56,17 @@ ```js | ||
### Contributors | ||
| **Commits** | **Contributor** | | ||
| --- | --- | | ||
| 19 | [jonschlinkert](https://github.com/jonschlinkert) | | ||
| 1 | [pointnet](https://github.com/pointnet) | | ||
### Building docs | ||
_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ | ||
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ | ||
To generate the readme and API documentation with [verb](https://github.com/verbose/verb): | ||
To generate the readme, run the following command: | ||
```sh | ||
$ npm install -g verb verb-generate-readme && verb | ||
$ npm install -g verbose/verb#dev verb-generate-readme && verb | ||
``` | ||
@@ -69,6 +76,6 @@ | ||
Install dev dependencies: | ||
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: | ||
```sh | ||
$ npm install -d && npm test | ||
$ npm install && npm test | ||
``` | ||
@@ -81,11 +88,11 @@ | ||
* [github/jonschlinkert](https://github.com/jonschlinkert) | ||
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) | ||
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) | ||
### License | ||
Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). | ||
Released under the [MIT license](https://github.com/jonschlinkert/find-file-up/blob/master/LICENSE). | ||
Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). | ||
Released under the [MIT License](LICENSE). | ||
*** | ||
_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on July 18, 2016._ | ||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 19, 2017._ |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
8729
1
0
93
2
78
+ Addedexpand-tilde@2.0.2(transitive)
+ Addedglobal-modules@1.0.0(transitive)
+ Addedglobal-prefix@1.0.2(transitive)
+ Addedis-windows@1.0.2(transitive)
+ Addedresolve-dir@1.0.1(transitive)
- Removedfs-exists-sync@^0.1.0
- Removedexpand-tilde@1.2.2(transitive)
- Removedfs-exists-sync@0.1.0(transitive)
- Removedglobal-modules@0.2.3(transitive)
- Removedglobal-prefix@0.1.5(transitive)
- Removedis-windows@0.2.0(transitive)
- Removedos-homedir@1.0.2(transitive)
- Removedresolve-dir@0.1.1(transitive)
Updatedresolve-dir@^1.0.0