read-tsconfig

Read `tsconfig.json` file

Usage no npm install needed!

<script type="module">
  import readTsconfig from 'https://cdn.skypack.dev/read-tsconfig';
</script>

README

read-tsconfig

Travis CI node npm PRs


Install

$ npm install read-tsconfig

Usage

const readTsconfig = require('read-tsconfig');

readTsconfig().then(config => {
    console.log(config);
    /*
    {
        compilerOptions: {
            outDir: 'dist',
            // ...
        }
    }
    */
});

console.log(readTsconfig.sync({cwd: './packages/foo'}));

API

readTsconfig(options)

readTsconfig.sync(options)

ReadOptions

  • cwd: <string>
    • default: process.cwd()

Related

  • has-tsconfig - Indicates whether the project has tsconfig.json file.

License

MIT © Guntur Poetra