# disposition

> A library for loading configuration files.

Latest version **0.5.0** (published 2018-02-03) · MPL-2.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

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

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2018-02-03 |
| First published | 2017-12-21 |
| Weekly downloads | 0 |
| License | MPL-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=6.0.0 |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Severen Redwood |
| Maintainers | severen |

## Links

- npm: https://www.npmjs.com/package/disposition
- Repository: https://github.com/severen/disposition
- Issues: https://github.com/severen/disposition/issues
- npm.io page: https://npm.io/package/disposition

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [ts-node](https://npm.io/package/ts-node.md) ^4.1.0
- [typescript](https://npm.io/package/typescript.md) 2.7.1

## Recent versions

- 0.5.0 (latest) — 2018-02-03
- 0.4.0 — 2018-01-11
- 0.3.0 — 2018-01-09
- 0.2.0 — 2018-01-07
- 0.1.0 — 2017-12-21

## README

# Disposition

[![NPM][npm-badge]][npm]
[![Node Support][node-badge]][node]
[![Travis CI][travis-ci-badge]][travis-ci]
[![Codecov][codecov-badge]][codecov]
[![David][david-badge]][david]

A NodeJS library for loading configuration files written in TypeScript or
JavaScript (ES2015+) as ECMAScript or CommonJS modules.

## Features

* Seamless support for configuration files written in either JavaScript _or_
  TypeScript.
* Support for both ECMAScript _and_ CommonJS modules.
* Support for JSX (currently only supported when using TypeScript).
* Support for the latest ECMAScript features, regardless of what Node supports
  (currently only supported when using TypeScript).

This is currently _beta_ quality software, so keep that in mind if you are
looking at using this for production software.

## Getting Started

First, install Disposition as a dependency.

```bash
~> yarn add disposition # or `npm install disposition`
```

Then create a basic configuration file:

```typescript
// example.config.ts
export default {
  foo: 'bar',
};
```

...and load it:

```typescript
// index.ts
import Disposition from 'disposition';

interface Config {
  foo: string;
}

const config: Config = new Disposition('example').load();
console.log(config.foo); // => bar
```

And that is the basics down!

## Changelog

The changelog can be found [here](CHANGELOG.md).

## Prior Art

[Cosmiconfig](https://github.com/davidtheclark/cosmiconfig) has inspired and
influenced this project.

<!-- Badge Links and Badges -->

[npm]: https://www.npmjs.com/package/disposition
[npm-badge]: https://img.shields.io/npm/v/disposition.svg
[node]: https://github.com/severen/disposition/blob/master/package.json
[node-badge]: https://img.shields.io/node/v/disposition.svg
[travis-ci]: https://travis-ci.org/severen/disposition
[travis-ci-badge]: https://img.shields.io/travis/severen/disposition.svg
[codecov]: https://codecov.io/gh/severen/disposition
[codecov-badge]: https://img.shields.io/codecov/c/github/severen/disposition.svg
[david]: https://david-dm.org/severen/disposition
[david-badge]: https://img.shields.io/david/severen/disposition.svg

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