Comparing version 1.0.0 to 1.0.2
17
Conar.js
@@ -202,3 +202,10 @@ var minimist = require('minimist'); | ||
} | ||
} catch (e) { | ||
self._sources._.logger("exception! "+JSON.stringify(e)); | ||
except.push(e); | ||
} | ||
try{ | ||
self._sources._.logger("trying to parse: pass1"); | ||
@@ -213,3 +220,10 @@ | ||
} | ||
} catch (e) { | ||
self._sources._.logger("exception! "+JSON.stringify(e)); | ||
except.push(e); | ||
} | ||
try{ | ||
self._sources._.logger("trying to parse: pass2"); | ||
@@ -224,5 +238,2 @@ | ||
} | ||
self._sources._.logger("trying to parse: pass3"); | ||
} catch (e) { | ||
@@ -229,0 +240,0 @@ |
{ | ||
"name": "conar", | ||
"description": "produces key-value objects from combined config file/argv/env values.", | ||
"version": "1.0.0", | ||
"version": "1.0.2", | ||
"homepage": "https://github.com/bengreenier/conar", | ||
@@ -30,3 +30,3 @@ "author": { | ||
"hulksmash": "0.0.2", | ||
"lconf": "0.0.4", | ||
"lconf": "0.0.5", | ||
"minimist": "^1.1.0" | ||
@@ -33,0 +33,0 @@ }, |
@@ -30,4 +30,6 @@ Conar [![Build Status](https://travis-ci.org/bengreenier/conar.svg?branch=master)](https://travis-ci.org/bengreenier/conar) | ||
+ __parse(file:string)__: | ||
+ __parse(file:string, [regex:RegExp])__: | ||
parse a file using [bengreenier/lconf](https://github.com/bengreenier/lconf) for configuration. supports `json`, `yaml`, `yml`, and `js` (with `module.exports = {};`) | ||
if `file` is a directory, all files inside the directory will be included. if `regex` is given, `file` (if actual file) or all files in directory (if `file` is a directory) | ||
will be compared against regex, and added if `regex.test(filePath)` returns `true`. | ||
@@ -34,0 +36,0 @@ + __order(first:number, second:number, third:number)__: |
@@ -88,2 +88,45 @@ var assert = require('assert'); | ||
it("should parse all config files given dir", function() { | ||
var c = conar() | ||
.env(false) | ||
.arg(false) | ||
.parse("./test") | ||
.opts(); | ||
assert.deepEqual(c, { | ||
"application": { | ||
"production": { | ||
"port": 3000, | ||
"debug": false | ||
}, | ||
"development": { | ||
"port": 2000, | ||
"debug": true, | ||
"pie": true | ||
} | ||
} | ||
}, "c shouldn't be "+JSON.stringify(c)); | ||
}); | ||
it("should parse config files given dir and regex", function() { | ||
var c = conar() | ||
.env(false) | ||
.arg(false) | ||
.parse("./test", /.?\.json$/) | ||
.opts(); | ||
assert.deepEqual(c, { | ||
"application": { | ||
"production": { | ||
"port": 3000, | ||
"debug": false | ||
}, | ||
"development": { | ||
"port": 2000, | ||
"debug": true | ||
} | ||
} | ||
}, "c shouldn't be "+JSON.stringify(c)); | ||
}); | ||
it("should parse config files (using lconf)", function() { | ||
@@ -90,0 +133,0 @@ var c = conar() |
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
22830
521
102
+ Addedlconf@0.0.5(transitive)
- Removedlconf@0.0.4(transitive)
Updatedlconf@0.0.5