# cat-settings

> Provides simple API to access and modify application settings, stored in JSON-file

Latest version **1.0.4** (published 2014-07-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install cat-settings
pnpm add cat-settings
yarn add cat-settings
bun add cat-settings
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2014-07-30 |
| First published | 2013-05-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Yurij Mikhalevich |
| Maintainers | 39dotyt |
| Keywords | json, jsonfile, settings |

## Links

- npm: https://www.npmjs.com/package/cat-settings
- Repository: https://github.com/39dotyt/cat-settings
- Issues: https://github.com/39dotyt/cat-settings/issues
- npm.io page: https://npm.io/package/cat-settings

## Dependencies (1)

- [jsonfile](https://npm.io/package/jsonfile.md) *

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.4 (latest) — 2014-07-30
- 1.0.3 — 2014-07-19
- 1.0.2 — 2014-07-19
- 1.0.1 — 2014-07-19
- 1.0.0 — 2014-01-12
- 0.9.1 — 2013-05-20
- 0.9.0 — 2013-05-16

## README

# cat-settings

Simple settings module for node.js, providing simple API to access and modify application settings, stored in JSON-file.
Uses jsonfile module.

JSON-file should store an object.

Installation:

```bash
$ npm install cat-settings
```

Example:

```javascript
var settings = require('cat-settings').loadSync(__dirname + '/settings.json');

// You may also use async load if it makes sense
settings.load(null, function(err) {
  if (err) {
    // ...
  }
});

app.set('port', settings.app.port);

// ...

settings.cat = {};
settings.cat.name = 'Leopold';
settings.saveSync();

// You may also use async save if it makes sense
settings.save(null, function(err) {
  if (err) {
    // ...
  }
});
```

When you pass file argument to load or save methods, you also change file, where settings are stored, in most cases
you should pass it only when you call load first time.

After, you can require cat-settings whenever you want and access parameters, without calling load.

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