# argv-config-file

> Pass a js configuration file on the command line.

Latest version **0.1.3** (published 2018-03-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install argv-config-file
pnpm add argv-config-file
yarn add argv-config-file
bun add argv-config-file
```

## 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.3 |
| Published | 2018-03-05 |
| First published | 2018-03-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 3.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | James Hight |
| Maintainers | jmerrick |
| Keywords | config, configuration, argv, file, extend |

## Links

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

## Dependencies (2)

- [minimist](https://npm.io/package/minimist.md) ^1.2.0
- [config-extend](https://npm.io/package/config-extend.md) ^0.1.1

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.1.3 (latest) — 2018-03-05
- 0.1.2 — 2018-03-05
- 0.1.1 — 2018-03-05
- 0.1.0 — 2018-03-05
- 0.0.2 — 2018-03-02
- 0.0.1 — 2018-03-02

## README

Argv Config File
================

Pass a js or json configuration file on the command line to a Node.js application. Configuration merging is done using [config-extend](https://www.npmjs.com/package/config-extend).

### Install

````bash
npm install --save argv-config-file
````


Usage
-------

### app.js

````javascript
const argvConfigFile = require('argv-config-file');

let config = argvConfigFile({
	// Default config
	// Extended using the file passed on the command line
	foo: ['bar'],
	biz: 'baz'
});
````


### my-config.js

````javascript
module.exports = {
	// Custom config
	foo: ['array', 'override']
}
````


### my-config.json

````json
{
	"foo": ["array", "override"]
}
````

### Run

````bash
node app.js -c /some/directory/my-config.js
node app.js --config=/some/directory/my-config.json
````


### Config Value

````javascript
{
	foo: ['array', 'override'],
	biz: 'baz'
}
````

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