# node-webkit-config

> helper to persist config data inside a node-webkit project

Latest version **0.1.0** (published 2014-09-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-webkit-config
pnpm add node-webkit-config
yarn add node-webkit-config
bun add node-webkit-config
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2014-09-27 |
| First published | 2014-09-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Timo Weiß |
| Maintainers | timoweiss |

## Links

- npm: https://www.npmjs.com/package/node-webkit-config
- npm.io page: https://npm.io/package/node-webkit-config

## Dependencies (2)

- [q](https://npm.io/package/q.md) ^1.0.1
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.0

## Recent versions

- 0.1.0 (latest) — 2014-09-27
- 0.0.2 — 2014-09-07
- 0.0.1 — 2014-09-07

## README

## 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:

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

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

## Usage

```js
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

```js
// 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);
    });
```

---
_Source: https://npm.io/package/node-webkit-config · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
