# find-rc

> Find a .rc file given a name

Latest version **4.0.2** (published 2023-11-22) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install find-rc
pnpm add find-rc
yarn add find-rc
bun add find-rc
```

## 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 | 4.0.2 |
| Published | 2023-11-22 |
| First published | 2016-06-04 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | wyatt |

## Links

- npm: https://www.npmjs.com/package/find-rc
- Repository: https://github.com/geek/find-rc
- Homepage: https://github.com/geek/find-rc#readme
- Issues: https://github.com/geek/find-rc/issues
- npm.io page: https://npm.io/package/find-rc

## Recent versions

- 4.0.2 (latest) — 2023-11-22
- 4.0.1 — 2020-04-15
- 4.0.0 — 2019-01-27
- 3.0.1 — 2016-06-15
- 3.0.0 — 2016-06-13
- 2.0.0 — 2016-06-04
- 1.1.2 — 2016-06-04
- 1.1.1 — 2016-06-04
- 1.1.0 — 2016-06-04
- 1.0.0 — 2016-06-04

## README

# `npm install find-rc`

Find a `rc` file given a name.  Inspiration from [rc](https://github.com/dominictarr/rc).

[![Build Status](https://secure.travis-ci.org/geek/find-rc.svg)](http://travis-ci.org/geek/find-rc)

The rc file is assumed to be written in JavaScript, therefore the filename must
be `.${app}rc.js` or `.${app}rc.cjs` or `.${app}rc.mjs` .  If your app is named 'lab' then the rc file must be named
`.labrc.js` (`.labrc.cjs` / `.labrc.mjs`).

Here is the order that folders will be searched:

1. Current directory
2. Parent of current directory, until the root folder is encountered
3. $HOME/.${app}rc.js
4. $HOME/.${app}rc.cjs
5. $HOME/.${app}rc.mjs
6. $HOME/.config/.${app}rc.js
7. $HOME/.config/.${app}rc.cjs
8. $HOME/.config/.${app}rc.mjs


### `(appname, [startDir])`

- `appname` - name of file you are looking for.  Example: `lab`.  It will be formatted as `.{appname}rc.js`
- `startDir` - (optional) directory to start looking for the file.  Defaults to `process.cwd`

Example

```js
const FindRc = require('find-rc');

const filePath = FindRc('lab');
if (filePath) {
  // load file and parse configuration
  const rc = require(filePath);
}
```

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