0.1.0 • Published 10 years ago

node-webkit-config v0.1.0

Weekly downloads
1
License
MIT
Repository
-
Last release
10 years ago

EARLY STATE - GO AWAY :)

This module is a thin wrapper around node's filesystem. You can persist data in the users dataPath. You need to make the nw.gui globally accessable via:

global.app = {
    gui: require(nw.gui)
};

Make sure that this is set before you make your first call!

Usage

var nwc = require('node-webkit-config');
// provide the nw.gui globally
global.app = {
    gui: require('nw.gui')
};

// set data
nwc({name: 'timo'})
    .then(function() {
        console.log('success');
    });
    
// get data
nwc()
    .then(function(config) {
        console.log(config.name);
    });

not done yet

// set individual path
var indiConf = {
        path: 'myData/path',
        file: 'config.json',
        name: 'indiConf'
    };
nwc.setPath(indiConf, {defaultVal: 'myVal'})
    .then(function() {
        console.log('success');
    });

// get object from individual path
nwc('indiConf')
    .then(function(config) {
        console.log(config);
    });
0.1.0

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago