$ npm install read-tsconfig-up
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'}));
- Params:
options
:<ReadOptions>
- Returns:
Promise<{}>
- Params:
options
:<ReadOptions>
- Returns:
<object>
cwd
:<string>
- Directory to start from.- default:
process.cwd()
- default:
- read-tsconfig - Read
tsconfig.json
file. - has-tsconfig - Indicates whether the project has
tsconfig.json
file.
MIT © Guntur Poetra