$ npm install read-tsconfig
const readTsconfig = require('read-tsconfig');
readTsconfig().then(config => {
console.log(config);
/*
{
compilerOptions: {
outDir: 'dist',
// ...
}
}
*/
});
console.log(readTsconfig.sync({cwd: './packages/foo'}));
- Params:
options
:<ReadOptions>
- Returns:
Promise<{}>
- Params:
options
:<ReadOptions>
- Returns:
<object>
cwd
:<string>
- default:
process.cwd()
- default:
- has-tsconfig - Indicates whether the project has
tsconfig.json
file.
MIT © Guntur Poetra