simple-json-set-get
A simple persistent user settings framework for just about anything.
This is an adapted version of npm package electron-settings. Itās still the same but now the config is stored at path/to/process/data/config.json
and some other tiny changes so that it works with anything and not just Electron.
In fact I donāt know if it works with Electron anymore. It will remain untested since I donāt use Electron. Issues and pull-requests welcome if you care enough about the package.
Demo
import { conf } from 'https://deno.land/x/simple_json_set_get@1.0.5/index.js';
conf.set('color', {
name: 'cerulean',
code: {
rgb: [0, 179, 230],
hex: '#003BE6'
}
});
conf.get('color.name');
// => "cerulean"
conf.get('color.code.rgb[1]');
// => 179
API Docs
Original API Docs can be found at electron-settings.js.org
Hardcoded config path
It was not always like this, but our projects didnāt need to customize the directory, so⦠we just hardcoded it.
Now itās always Deno.cwd() + "/data/config.json"
If you want to change the config file directory and name, you need to download the code repository and modify it in the original code.
Development notes
I forked this project from electron-settings
NPM package (url)
I made from it sharon-settings
for Nodejs (url)
And now I made simple_json_set_get
for Deno
I maintain the repository for my teamās projects. If you want, you can post issues on github, pull requests, whatever.
Itās not typed because the original is not typed. Such is the path of least resistance.
Itās also not promisified because the original was not promisified when I forked it.