Merge pull request #5 from WindowsAzure/master

Release 0.0.2 merge master to dev
This commit is contained in:
Chris Tavares 2013-07-09 09:21:28 -07:00
Родитель 98609207c4 dd873e4956
Коммит 32b9678ddd
2 изменённых файлов: 26 добавлений и 1 удалений

Просмотреть файл

@ -72,3 +72,28 @@ c3.configure('production', function (c) {
c.useSql('realDatabase', 'actualDb');
});
```
Are you making changes to a global configuration in your unit tests, and want
to ensure you've restored the state after your test? Use a snapshot:
```javascript
var c4 = envconf.createConfig();
c4.configure(function (c) {
c.set('originalValue', 'one');
});
// set up contents of c4
var snapshot = c4.snapshot();
c4.configure(function (c) {
c.set('originalValue', 'two');
});
c4.restore(snapshot);
c4.get('originalValue').should.equal('one');
```
Snapshot/restore also saves and restores any child configurations.

Просмотреть файл

@ -6,7 +6,7 @@
"Rodrigues, Andre <andrerod@microsoft.com>",
"Tavares, Chris <ctavares@microsoft.com>"
],
"version": "0.0.1",
"version": "0.0.2",
"description": "a module for express-style programmatic configuration",
"main": "lib/index.js",
"tags": ["config", "environment"],