# application-config

> Store your applications config where the operating system wants you to.

Latest version **3.0.0** (published 2023-01-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install application-config
pnpm add application-config
yarn add application-config
bun add application-config
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2023-01-06 |
| First published | 2014-12-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | ^14.18.0 \|\| ^16.14.0 \|\| >=18.0.0 |
| Dependencies | 3 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | linusu, feross |

## Links

- npm: https://www.npmjs.com/package/application-config
- Repository: https://github.com/LinusU/node-application-config
- Homepage: https://github.com/LinusU/node-application-config#readme
- Issues: https://github.com/LinusU/node-application-config/issues
- npm.io page: https://npm.io/package/application-config

## Dependencies (3)

- [load-json-file](https://npm.io/package/load-json-file.md) ^7.0.1
- [write-json-file](https://npm.io/package/write-json-file.md) ^5.0.0
- [application-config-path](https://npm.io/package/application-config-path.md) ^1.0.0

## Recent versions

- 3.0.0 (latest) — 2023-01-06
- 2.0.0 — 2019-11-16
- 1.0.1 — 2016-09-23
- 1.0.0 — 2016-07-23
- 0.2.2 — 2016-05-09
- 0.2.1 — 2016-04-20
- 0.2.0 — 2015-08-01
- 0.1.2 — 2015-07-17
- 0.1.1 — 2014-12-28
- 0.1.0 — 2014-12-28

## README

# Node.js Application Config

Store your applications config where the operating system wants you to.

## Installation

```sh
npm install --save application-config
```

## Usage

```js
import createApplicationConfig from 'application-config'

const cfg = createApplicationConfig('App Name')

// Read the stored data
const data = await cfg.read()

// Write new config
await cfg.write({ n: 1337 })

// Trash the stored config
await cfg.trash()
```

## API

### `createApplicationConfig(name)`

Creates and return a new instance with the provided name.

### `cfg.read()`

Read the stored configuration. Returns a Promise that settles with the data.

### `cfg.write(data)`

Write new configuration. Returns a Promise.

### `cfg.trash()`

Remove the stored configuration. Returns a Promise.

### `cfg.filePath`

The path to the underlying file in which the configuration is stored.

## Config location

Platform | Location
--- | ---
OS X | `~/Library/Application Support/<name>/config.json`
Linux (XDG) | `$XDG_CONFIG_HOME/<name>/config.json`
Linux (Legacy) | `~/.config/<name>/config.json`
Windows (> Vista) | `%LOCALAPPDATA%/<name>/config.json`
Windows (XP, 2000) | `%USERPROFILE%/Local Settings/Application Data/<name>/config.json`

## License

MIT

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