Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/iguntur/read-tsconfig

Read tsconfig.json file
https://github.com/iguntur/read-tsconfig

compiler config json5 pkg read ts tsc tsconfig typescript

Last synced: about 11 hours ago
JSON representation

Read tsconfig.json file

Awesome Lists containing this project

README

        

# read-tsconfig

[![Travis CI](https://img.shields.io/travis/iguntur/read-tsconfig.svg?style=flat-square)](https://travis-ci.org/iguntur/read-tsconfig)
[![node](https://img.shields.io/node/v/read-tsconfig.svg?style=flat-square)](#)
[![npm](https://img.shields.io/npm/v/read-tsconfig.svg?style=flat-square)](https://www.npmjs.org/package/read-tsconfig)
[![PRs](https://img.shields.io/badge/PRs-welcome-blue.svg?style=flat-square)](#)

---

## Install

```console
$ npm install read-tsconfig
```

## Usage

```js
const readTsconfig = require('read-tsconfig');

readTsconfig().then(config => {
console.log(config);
/*
{
compilerOptions: {
outDir: 'dist',
// ...
}
}
*/
});

console.log(readTsconfig.sync({cwd: './packages/foo'}));
```

## API

### readTsconfig(`options`)

- Params:
- `options`: [``](#readoptions)
- Returns: `Promise<{}>`

### readTsconfig.sync(`options`)

- Params:
- `options`: [``](#readoptions)
- Returns: ``

#### `ReadOptions`

- `cwd`: ``
- default: `process.cwd()`

## Related

- [has-tsconfig](https://github.com/iguntur/has-tsconfig) - Indicates whether the project has `tsconfig.json` file.

## License

MIT © [Guntur Poetra](https://github.com/iguntur)