Skip to content

Commit

Permalink
Bump conf dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Nov 1, 2019
1 parent 2643a99 commit 69b029f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"save"
],
"dependencies": {
"conf": "^6.0.0",
"conf": "^6.2.0",
"type-fest": "^0.7.1"
},
"devDependencies": {
Expand Down
15 changes: 10 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,11 @@ store.set('foo', '1');

Type: `object`

**Don't use this feature until [this issue](https://github.com/sindresorhus/conf/issues/92) has been fixed.**

You can use migrations to perform operations to the store whenever a version is upgraded.

The `migrations` object should consist of a key-value pair of `version`: `handler`.
The `migrations` object should consist of a key-value pair of `'version': handler`. The `version` can also be a [semver range](https://github.com/npm/node-semver#ranges).

Example:

Expand All @@ -113,14 +115,17 @@ const Store = require('electron-store');
const store = new Store({
migrations: {
'0.0.1': store => {
store.set('debug phase', true);
store.set('debugPhase', true);
},
'1.0.0': store => {
store.delete('debug phase');
store.set('phase', '1.0');
store.delete('debugPhase');
store.set('phase', '1.0.0');
},
'1.0.2': store => {
store.set('phase', '>1.0');
store.set('phase', '1.0.2');
},
'>=2.0.0': store => {
store.set('phase', '>=2.0.0');
}
}
});
Expand Down

0 comments on commit 69b029f

Please sign in to comment.