# node-app-settings

> Store application settings in popular format like json, ini etc

Latest version **0.0.5** (published 2017-09-08) · Apache 2.0 license · 0 weekly downloads

## Install

```sh
npm install node-app-settings
pnpm add node-app-settings
yarn add node-app-settings
bun add node-app-settings
```

## 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.0.5 |
| Published | 2017-09-08 |
| First published | 2017-02-21 |
| Weekly downloads | 0 |
| License | Apache 2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | woodstage |
| Maintainers | guyu |
| Keywords | settings, node-app |

## Links

- npm: https://www.npmjs.com/package/node-app-settings
- Repository: https://github.com/woodstage/node-app-settings
- Homepage: https://github.com/woodstage/node-app-settings#readme
- Issues: https://github.com/woodstage/node-app-settings/issues
- npm.io page: https://npm.io/package/node-app-settings

## Dependencies (3)

- [ini](https://npm.io/package/ini.md) ^1.3.4
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.8.2
- [bluebird](https://npm.io/package/bluebird.md) ^3.4.7

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 0.0.5 (latest) — 2017-09-08
- 0.0.4 — 2017-02-28
- 0.0.3 — 2017-02-24
- 0.0.2 — 2017-02-22
- 0.0.0 — 2017-02-21

## README

# node-app-settings
Store app settings

[![](https://img.shields.io/travis/woodstage/node-app-settings.svg?style=flat-square)](https://travis-ci.org/woodstage/node-app-settings)
[![Coveralls](https://img.shields.io/coveralls/woodstage/node-app-settings.svg?style=flat-square)](https://coveralls.io/github/woodstage/node-app-settings)


[![npm package](https://img.shields.io/npm/v/node-app-settings.svg?style=flat-square)](https://www.npmjs.org/package/node-app-settings)
[![NPM downloads](http://img.shields.io/npm/dm/node-app-settings.svg?style=flat-square)](https://npmjs.org/package/node-app-settings)
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/woodstage/node-app-settings.svg)](http://isitmaintained.com/project/woodstage/node-app-settings "Average time to resolve an issue")

## Supported Types
* JSON
* INI
* YAML

## Usage

You can create settings object by providing setting file path and type. If the file doesn't exist, a new file will be created on the path.
```javascript
const appSettings = require('node-app-settings');

let iniSetting = appSettings.create('settings.ini', 'INI');
let jsonSetting = appSettings.create('settings.json', 'JSON');
let yamlSetting = appSettings.create('settings.yml', 'YAML');
```

You can then get/update settings on the object. And if you want to store any settings, don't forget to call **flush** before exit.
```javascript
let settings = appSettings.create('settings.json');//Absolute path or relative path
let config = settings.config; //Get the setting data object
config.user = 'Bob';
config.password = 'xxx';
settings.flush((err => {
	console.log(err);
})); //Save to file asynchronous
settings.flushSync(); //Save to file
```

## LICENSE
MIT

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