From 9882bdcf25b8fc35308b0123540be2927ca765a3 Mon Sep 17 00:00:00 2001 From: Troy McKinnon Date: Tue, 29 May 2018 21:57:58 -0500 Subject: [PATCH] Update conf to 2.0 (#43) --- fixture-cwd.js | 2 ++ package.json | 2 +- readme.md | 9 +++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/fixture-cwd.js b/fixture-cwd.js index 8a9467e..f43bf38 100644 --- a/fixture-cwd.js +++ b/fixture-cwd.js @@ -13,9 +13,11 @@ process.on('uncaughtException', err => { console.log(electron.app.getPath('userData')); const store = new Store({cwd: 'foo'}); +store.set('unicorn', '🦄'); console.log(store.path); const store2 = new Store({cwd: path.join(__dirname, 'bar')}); +store2.set('ava', '🚀'); console.log(store2.path); electron.app.quit(); diff --git a/package.json b/package.json index 18b04c1..4677998 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "save" ], "dependencies": { - "conf": "^1.3.0" + "conf": "^2.0.0" }, "devDependencies": { "ava": "*", diff --git a/readme.md b/readme.md index cea764b..2718b07 100644 --- a/readme.md +++ b/readme.md @@ -84,6 +84,15 @@ It also has the added bonus of ensuring the config file's integrity. If the file When specified, the store will be encrypted using the [`aes-256-cbc`](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation) encryption algorithm. +#### fileExtension + +type: `string`
+Default: `json` + +Extension of the config file. + +You would usually not need this, but could be useful if you want to interact with a file with a custom file extension that can be associated with your app. These might be simple save/export/preference files that are intended to be shareable or saved outside of the app. + ### Instance You can use [dot-notation](https://github.com/sindresorhus/dot-prop) in a `key` to access nested properties.