Skip to content

Commit

Permalink
Merge pull request #68 from jonathansamines/2.x
Browse files Browse the repository at this point in the history
Update README to fix examples usage, fix tests
  • Loading branch information
shaunwarman authored Apr 10, 2017
2 parents f28d39f + afaca34 commit 9bd65d0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
confit
======

Lead Maintainer: [Shaun Warman](https://github.com/shaunwarman)
Lead Maintainer: [Shaun Warman](https://github.com/shaunwarman)

[![Build Status](https://travis-ci.org/krakenjs/confit.svg?branch=2.x)](https://travis-ci.org/krakenjs/confit)
[![Build Status](https://travis-ci.org/krakenjs/confit.svg?branch=2.x)](https://travis-ci.org/krakenjs/confit)

Simple, environment-based configuration. `confit` loads a default JSON
configuration file, additionally loading environment-specific files, if applicable.
It will also process the loaded files using any configured
[shortstop](https://github.com/paypal/shortstop) protocol handlers—see **Options** below.

`confit` adds support for adding JavaScript-style comments in your json files as each file is processed by [shush](https://github.com/totherik/shush) before being merged into your config.
`confit` adds support for adding JavaScript-style comments in your json files as each file is processed by [shush](https://github.com/krakenjs/shush) before being merged into your config.


## Usage
Expand All @@ -20,8 +20,8 @@ var confit = require('confit');

### confit([options])
* `options` (*String* | *Object*) - the base directory in which config files live or a configuration object. If no
arguments is provided, defaults to the directory of the calling file. Signature `function (err, config) {}`
* returns - config factory.
arguments is provided, defaults to the directory of the calling file.
* returns - [config factory](#config-factory).

```javascript
'use strict';
Expand Down Expand Up @@ -65,7 +65,7 @@ confit(options)
## Options
* `basedir` (*String*) - the base directory in which config files can be found.
* `protocols` (*Object*) - An object containing a mapping of
[shortstop](https://github.com/paypal/shortstop) protocols to either handler implementations or an array or handler implementations.
[shortstop](https://github.com/krakenjs/shortstop) protocols to either handler implementations or an array or handler implementations.
These protocols will be used to process the config data prior to registration.
If using an array of handler implementations, each handler is run in series (see [`Multiple handlers` in the shortstop README](https://github.com/krakenjs/shortstop#multiple-handlers)).
* `defaults` (*String*) - the name of the file containing all default values.
Expand All @@ -83,8 +83,8 @@ var handlers = require('shortstop-handlers');
var options = {
basedir: path.join(__dirname, 'config'),
protocols: {
file: handlers.file,
glob: handlers.glob
file: handlers.file(__dirname),
glob: handlers.glob(__dirname)
}
};

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"devDependencies": {
"babel": "4.7.3",
"glob": "^4.3.5",
"istanbul": "^0.3.5",
"jshint": "^2.6.0",
"nyc": "^3.0.1",
"tap": "^1.3.1"
Expand Down
1 change: 1 addition & 0 deletions test/confit-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,4 +557,5 @@ test('confit', function (t) {
});
});

t.end();
});
4 changes: 3 additions & 1 deletion test/provider-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test('env', function (t) {
process.env = env;
});

t.test('env variables', function () {
t.test('env variables', function (t) {
var val;

process.env = {
Expand All @@ -25,6 +25,8 @@ test('env', function (t) {
t.equal(val.env, undefined);
t.end();
});

t.end();
});


Expand Down

0 comments on commit 9bd65d0

Please sign in to comment.