From 7a430c60589239cf91bef0d2c4b1cc68a49b8ff8 Mon Sep 17 00:00:00 2001 From: Corey Farrell Date: Fri, 5 Apr 2019 19:39:31 -0400 Subject: [PATCH] Update dependencies, drop node.js 6. Return undefined instead of null when package.json can't be found. --- .travis.yml | 1 - package.json | 6 +++--- readme.md | 2 +- test.js | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index aa6d496..cc26e17 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,5 @@ language: node_js node_js: - '10' - '8' - - '6' after_script: - 'cat ./coverage/lcov.info | ./node_modules/.bin/coveralls' diff --git a/package.json b/package.json index 10957ed..01a9984 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "license": "MIT", "repository": "avajs/find-cache-dir", "engines": { - "node": ">=6" + "node": ">=8" }, "scripts": { "test": "xo && nyc ava" @@ -23,8 +23,8 @@ ], "dependencies": { "commondir": "^1.0.1", - "make-dir": "^2.0.0", - "pkg-dir": "^3.0.0" + "make-dir": "^3.0.0", + "pkg-dir": "^4.1.0" }, "devDependencies": { "ava": "^1.3.1", diff --git a/readme.md b/readme.md index b05e585..f538116 100644 --- a/readme.md +++ b/readme.md @@ -60,7 +60,7 @@ findCacheDir({name: 'unicorns'}); ### findCacheDir([options]) -Finds the cache directory using the supplied options. The algorithm tries to find a `package.json` file, searching every parent directory of the `cwd` specified (or implied from other options). It returns a `string` containing the absolute path to the cache directory, or `null` if `package.json` was never found. +Finds the cache directory using the supplied options. The algorithm tries to find a `package.json` file, searching every parent directory of the `cwd` specified (or implied from other options). It returns a `string` containing the absolute path to the cache directory, or `undefined` if `package.json` was never found. #### options diff --git a/test.js b/test.js index 4f22f5c..f4e8e4b 100644 --- a/test.js +++ b/test.js @@ -35,7 +35,7 @@ test('thunk', t => { t.is(thunk('bar'), path.join(directory, 'bar')); }); -test('returns null if it can\'t find package.json', t => { +test('returns undefined if it can\'t find package.json', t => { process.chdir(path.join(__dirname, '..')); - t.is(findCacheDir({name: 'foo'}), null); + t.is(findCacheDir({name: 'foo'}), undefined); });