# confortable

> Finds the right recursively placed config file

Latest version **1.0.0** (published 2015-11-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install confortable
pnpm add confortable
yarn add confortable
bun add confortable
```

## 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.0 |
| Published | 2015-11-14 |
| First published | 2012-07-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Eirik Albrigtsen |
| Maintainers | clux |
| Keywords | config, finder, recursive, comfortable, nottypo |

## Links

- npm: https://www.npmjs.com/package/confortable
- Repository: https://github.com/clux/confortable
- Homepage: https://github.com/clux/confortable#readme
- Issues: https://github.com/clux/confortable/issues
- npm.io page: https://npm.io/package/confortable

## 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

- 1.0.0 (latest) — 2015-11-14
- 0.2.2 — 2014-07-22
- 0.2.1 — 2013-04-10
- 0.2.0 — 2012-10-26
- 0.1.5 — 2012-08-20
- 0.1.4 — 2012-08-17
- 0.1.3 — 2012-07-18
- 0.1.2 — 2012-07-13
- 0.1.1 — 2012-07-13
- 0.1.0 — 2012-07-03

## README

# Confortable
[![npm status](http://img.shields.io/npm/v/confortable.svg)](https://www.npmjs.org/package/confortable)
[![build status](https://secure.travis-ci.org/clux/confortable.svg)](http://travis-ci.org/clux/confortable)
[![dependency status](https://david-dm.org/clux/confortable.svg)](https://david-dm.org/clux/confortable)
[![coverage status](http://img.shields.io/coveralls/clux/confortable.svg)](https://coveralls.io/r/clux/confortable)

Confortable is a lightweight config file locator. It will look at the execution cwd, and if no config matching the name is found, and the cwd is inside $HOME, it will keep going up one directory until it hits $HOME. Example usage can be seen in [logule](https://github.com/clux/logule/blob/master/logule.js#L6). and [combustion](https://github.com/clux/combustion/blob/master/lib/precompiler.js#L4).

It does not parse the config, and thus does not enforce any structure upon the config file itself.
It simply returns the best existing path || null.

## Usage
Basic usage:

```js
var conf = require('confortable');
confPath = conf('.confName'); // if non-null, this can be read by fs or required if js compatible
```

Optionally, a start directory (if cwd isn't sufficient) can be specified for the search start:

```js
var confPath = require('confortable')('.combustion', templateDir);
```

A final optional setting is a fallback directory, in case the recursive search fails, but you still want to see if a config exists somewhere else (like say the path of the parent module). In this use case, you have to specify the start as well.

```js
var fallback = require('path').dirname(module.parent.filename);
var confPath = require('confortable')('.logule', process.cwd(), fallback);
```

## Installation

```bash
$ npm install confortable
```

## License
MIT-Licensed. See LICENSE file for details.

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