# command-line-config

> `npm i command-line-config` > Breaking change in version 2: ESM style exports

Latest version **2.1.1** (published 2026-02-18) · 0 weekly downloads

## Install

```sh
npm install command-line-config
pnpm add command-line-config
yarn add command-line-config
bun add command-line-config
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.1.1 |
| Published | 2026-02-18 |
| First published | 2012-11-16 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | tehshrike, daytonlowell, dillon_sadofsky |

## Links

- npm: https://www.npmjs.com/package/command-line-config
- npm.io page: https://npm.io/package/command-line-config

## Recent versions

- 2.1.1 (latest) — 2026-02-18
- 2.1.0 — 2026-02-13
- 2.0.0 — 2023-08-25
- 1.4.1 — 2013-01-23
- 1.4.0 — 2013-01-02
- 1.3.0 — 2012-11-26
- 1.2.0 — 2012-11-17
- 1.1.0 — 2012-11-17
- 1.0.0 — 2012-11-16

## README

# Command Line Config

## Install

`npm i command-line-config`
> Breaking change in version 2: ESM style exports

## Usage

Quick and dirty loading/saving of JSON files.

```js
import * as settings_access from 'command-line-config'
//or...
//import { load, save } from 'command-line-config'

let settings = settings_access.load('./some_file.json')
settings.dumb = false
settings_access.save(settings, './some_file.json')
```

All paths are interpreted relative to the current working directory.

If you don't specify a path to load, the module assumes the file was passed in via the command-line, like so: `node your-script.js config-file.json`

```js
let settings = settings_access.load()
settings.wat = "WHERE DID YOU COME FROM"
settings_access.save(settings)
```

Which command-line argument will be interpreted as a file to be opened?  The first one to resolve to an actual file, of course!

All file-system interactions are done synchronously, which means you most likely only want to be interacting with it when your app launches/terminates (which is the most likely use case anyway).

Written for ISoft Data Systems, licensed [WTFPL](http://wtfpl2.com).

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