Skip to content

Commit

Permalink
Fixing the babelrc issue when used in other projects
Browse files Browse the repository at this point in the history
  • Loading branch information
shidhincr committed Jun 26, 2016
1 parent 54ec5f2 commit 179ed25
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 18 deletions.
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,24 @@ var config = new reconfig({
var greetJohn = config.get('greet', {who: 'John'}); // Hello, John!
```

By default, reconfig uses `:` to interpolate the parameters. For example, in the above code, `:who` gets replaced by the parameter value.
You can specify your own interpolation for resolving the parameters by setting the `paramsInterpolation` option.

```javascript

var reconfig = require('reconfig');

var config = new reconfig({
greet: 'Hello {who}!'
}, {
paramsInterpolation: ['{', '}']
});

var greetJohn = config.get('greet', {who: 'John'}); // Hello, John!
```

Last but not least, reconfig lets you specify a default value to
return if a config valu you're trying to access doesnt exist:
return if a config value you're trying to access doesn't exist:

``` javascript
var reconfig = require('reconfig');
Expand Down Expand Up @@ -155,7 +171,7 @@ var configValues = {
b: [2]
};

var config = new reconfig(configValues, 'MYPREFIX');
var config = new reconfig(configValues, { envPrefix: 'MYPREFIX' });
```

and you'll be able to modify or add new values directly from your shell!
Expand All @@ -177,7 +193,7 @@ The default properties separator is: `_` (1 underscore).
You can use your custom separator passing it to the constructor as 3rd parameter:

```javascript
var config = new reconfig(configValues, 'MYPREFIX', '__');
var config = new reconfig(configValues, { envPrefix: 'MYPREFIX', separator: '__' });
```

## Installation
Expand Down
7 changes: 3 additions & 4 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "reconfig",
"main": "reconfig.js",
"version": "1.4.2",
"main": "build/reconfig.js",
"version": "2.0.0",
"homepage": "https://github.com/namshi/reconfig",
"authors": [
"Alex Nadalin <[email protected]>"
Expand All @@ -16,8 +16,7 @@
"no-bs"
],
"dependencies": {
"lodash": "4.5.1",
"vpo": "2.0.0"
"lodash": "4.5.1"
},
"license": "MIT",
"ignore": [
Expand Down
2 changes: 1 addition & 1 deletion build/reconfig.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 179ed25

Please sign in to comment.