https://github.com/eth-p/node-tsconfig-files
A small library to find the source files from a tsconfig.json file.
https://github.com/eth-p/node-tsconfig-files
Last synced: about 1 year ago
JSON representation
A small library to find the source files from a tsconfig.json file.
- Host: GitHub
- URL: https://github.com/eth-p/node-tsconfig-files
- Owner: eth-p
- Created: 2019-02-13T01:54:56.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-10-11T16:17:27.000Z (over 3 years ago)
- Last Synced: 2025-02-09T00:29:59.281Z (over 1 year ago)
- Language: TypeScript
- Size: 77.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tsconfig-files
[](https://badge.fury.io/js/tsconfig-files)
A small library to find source files from a tsconfig.json file.
## Install
```bash
$ npm install tsconfig-files
```
## Usage
example.js:
```javascript
// import {getFilesFromTsconfig} from "tsconfig-files";
const getFilesFromTsconfig = require("tsconfig-files").getFilesFromTsconfig;
getFilesFromTsconfig('.').then((files) => {
console.log(files);
}, (error) => {
console.error(error);
});
```
## API
**getFilesFromTsconfig(cwd): Promise**
Returns a `Promise` containing the files matched by `tsconfig.json` in `cwd`.
**getFilesFromTsconfigSync(cwd): string[]>**
Returns the files matched by `tsconfig.json` in `cwd`.
The async form is preferred over this function.
**getFilesFromTsconfigJson(json, root): Promise**
Returns a `Promise` containing the files matched by the provided tsconfig json.
**getFilesFromTsconfigSync(json, root): string[]>**
Returns the files matched by the provided tsconfig json.
The async form is preferred over this function.
## License
MIT © [eth-p](https://github.com/eth-p)