read-tsconfig-up
v1.0.1
Published
Find up and read `tsconfig.json` file
Downloads
2
Maintainers
Readme
read-tsconfig-up
Install
$ npm install read-tsconfig-up
Usage
const readTsconfigUp = require('read-tsconfig-up');
readTsconfigUp().then(result => {
console.log(result);
/*
{
tsconfig: {
compilerOptions: {
outDir: 'dist',
// ...
}
},
path: '/path/to/project/tsconfig.json'
}
*/
});
console.log(readTsconfigUp.sync({cwd: './packages/foo'}));
API
readTsconfigUp(options
)
- Params:
options
:<ReadOptions>
- Returns:
Promise<{}>
readTsconfig.sync(options
)
- Params:
options
:<ReadOptions>
- Returns:
<object>
ReadOptions
cwd
:<string>
- Directory to start from.- default:
process.cwd()
- default:
Related
- read-tsconfig - Read
tsconfig.json
file. - has-tsconfig - Indicates whether the project has
tsconfig.json
file.
License
MIT © Guntur Poetra