# TSConfig

[![NPM version](https://img.shields.io/npm/v/tsconfig.svg?style=flat)](https://npmjs.org/package/tsconfig) [![NPM downloads](https://img.shields.io/npm/dm/tsconfig.svg?style=flat)](https://npmjs.org/package/tsconfig) [![Build status](https://img.shields.io/travis/TypeStrong/tsconfig.svg?style=flat)](https://travis-ci.org/TypeStrong/tsconfig) [![Test coverage](https://img.shields.io/coveralls/TypeStrong/tsconfig.svg?style=flat)](https://coveralls.io/r/TypeStrong/tsconfig?branch=master)

Resolve and parse [`tsconfig.json`](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html), replicating TypeScript's behaviour.

## Usage

See the [TypeScript docs](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html) for information on setting up `tsconfig.json`.

### API

* **resolve(cwd: string, path?: string): Promise\<string | void>** Resolve `tsconfig.json`, like TypeScript, allowing a path to be specified and falling back to recursively resolving `tsconfig.json` upward when no path is specified.
* **resolveSync(cwd: string, path?: string): string | void** Synchronous `resolve`.
* **find(cwd: string): Promise\<string | void>** Standalone behaviour of recursively resolving `tsconfig.json` upward.
* **findSync(cwd: string): string | void** Synchronous `find`.
* **load(cwd: string, path?: string): Promise<{ path?: string, config: any }>** Resolve, load and parse `tsconfig.json`.
* **loadSync(cwd: string, path?: string): { path?: string, config: any }** Synchronous `load`.
* **readFile(filename: string): Promise** Read a JSON file as `tsconfig.json` (strip BOM, parse JSON and support empty contents).
* **readFileSync(filename: string): any** Synchronous `readFile`.
* **parse(contents: string, filename: string): any** Parse file contents as `tsconfig.json` (strip BOM, parse JSON and support empty contents).

## Contributing

Feel free to open issues for discussion.

```sh
# Install dependencies/typings.
npm install

# Run test suite.
npm test
```

## License

MIT License


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mediamagic.dev/product-docs/services/graphql-gateway/node_modules/tsconfig.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
