cosmiconfig
Advanced tools
Comparing version 2.1.1 to 2.1.2
# Changelog | ||
## 2.1.2 | ||
- Fixed: bug where an `ENOENT` error would be thrown is `searchPath` referenced a non-existent file. | ||
- Fixed: JSON parsing errors in Node v7. | ||
## 2.1.1 | ||
@@ -4,0 +9,0 @@ |
'use strict'; | ||
var path = require('path'); | ||
var fs = require('fs'); | ||
var isDir = require('is-directory'); | ||
var loadPackageProp = require('./loadPackageProp'); | ||
@@ -100,5 +100,5 @@ var loadRc = require('./loadRc'); | ||
return new Promise(function (resolve, reject) { | ||
fs.stat(filepath, function (err, stats) { | ||
return isDir(filepath, function (err, dir) { | ||
if (err) return reject(err); | ||
return resolve(stats.isDirectory()); | ||
return resolve(dir); | ||
}); | ||
@@ -105,0 +105,0 @@ }); |
'use strict'; | ||
var yaml = require('js-yaml'); | ||
var parseJson = require('parse-json'); | ||
var requireFromString = require('require-from-string'); | ||
var readFile = require('./readFile'); | ||
var parseJson = require('./parseJson'); | ||
@@ -8,0 +8,0 @@ module.exports = function (filepath, options) { |
'use strict'; | ||
var path = require('path'); | ||
var parseJson = require('parse-json'); | ||
var readFile = require('./readFile'); | ||
var parseJson = require('./parseJson'); | ||
@@ -7,0 +7,0 @@ module.exports = function (packageDir, options) { |
'use strict'; | ||
var yaml = require('js-yaml'); | ||
var parseJson = require('parse-json'); | ||
var requireFromString = require('require-from-string'); | ||
var readFile = require('./readFile'); | ||
var parseJson = require('./parseJson'); | ||
@@ -8,0 +8,0 @@ module.exports = function (filepath, options) { |
{ | ||
"name": "cosmiconfig", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "Find and load configuration from a package.json property, rc file, or CommonJS module", | ||
@@ -12,5 +12,5 @@ "main": "index.js", | ||
"lint": "node-version-gte-4 && eslint . || echo \"ESLint not supported\"", | ||
"ava": "ava test/*.test.js", | ||
"coverage": "nyc npm run ava && nyc report --reporter=html && open coverage/index.html", | ||
"test": "npm run ava && npm run lint" | ||
"tape": "tape test/*.test.js | tap-spec", | ||
"coverage": "nyc npm run tape && nyc report --reporter=html && open coverage/index.html", | ||
"test": "npm run tape && npm run lint" | ||
}, | ||
@@ -36,19 +36,21 @@ "repository": { | ||
"dependencies": { | ||
"is-directory": "^0.3.1", | ||
"js-yaml": "^3.4.3", | ||
"json-parse-helpfulerror": "^1.0.3", | ||
"minimist": "^1.2.0", | ||
"object-assign": "^4.1.0", | ||
"os-homedir": "^1.0.1", | ||
"parse-json": "^2.2.0", | ||
"require-from-string": "^1.1.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "0.16.0", | ||
"eslint": "3.5.0", | ||
"eslint": "^3.13.0", | ||
"eslint-config-davidtheclark-node": "^0.2.0", | ||
"eslint-plugin-node": "^2.0.0", | ||
"eslint-plugin-node": "^3.0.5", | ||
"expect": "^1.20.2", | ||
"lodash": "4.16.1", | ||
"lodash": "^4.17.4", | ||
"node-version-check": "^2.1.1", | ||
"nyc": "^8.3.0", | ||
"sinon": "1.17.6" | ||
"nyc": "^10.0.0", | ||
"sinon": "^1.17.7", | ||
"tap-spec": "^4.1.1", | ||
"tape": "^4.6.3" | ||
}, | ||
@@ -55,0 +57,0 @@ "engines": { |
@@ -183,3 +183,3 @@ # cosmiconfig | ||
Find and load a configuration file. Returns `null` if nothing is found, or an object with two properties: | ||
Find and load a configuration file. Returns a Promise that resolves with `null`, if nothing is found, or an object with two properties: | ||
- `config`: The loaded and parsed configuration. | ||
@@ -186,0 +186,0 @@ - `filepath`: The filepath where this configuration was found. |
22148
12
305
1
7
10
+ Addedis-directory@^0.3.1
+ Addedis-directory@0.3.1(transitive)
+ Addedjju@1.4.0(transitive)
+ Addedjson-parse-helpfulerror@1.0.3(transitive)
- Removedparse-json@^2.2.0
- Removederror-ex@1.3.2(transitive)
- Removedis-arrayish@0.2.1(transitive)
- Removedparse-json@2.2.0(transitive)