@mnrendra/read-tsconfig
v1.3.0
Published
Read tsconfig.json file in your project.
Downloads
117
Maintainers
Readme
@mnrendra/read-tsconfig
Read tsconfig.json
file in your project.
Install
npm i @mnrendra/read-tsconfig
Usage
Using CommonJS
:
const { readTSConfig, readTSConfigSync } = require('@mnrendra/read-tsconfig')
// Asynchronously
readTSConfig()
.then(({ compilerOptions }) => {
console.log('asynchronously:', compilerOptions)
})
// Synchronously
const { compilerOptions } = readTSConfigSync()
console.log('synchronously:', compilerOptions)
Using ES Module
:
import { readTSConfig, readTSConfigSync } from '@mnrendra/read-tsconfig'
// Asynchronously
readTSConfig()
.then(({ compilerOptions }) => {
console.log('asynchronously:', compilerOptions)
})
// Synchronously
const { compilerOptions } = readTSConfigSync()
console.log('synchronously:', compilerOptions)
Types
import type {
TSConfig,
BuildOptions,
CompileOnSave,
CompilerOptions,
BaseURL,
Paths,
Exclude,
Extends,
Files,
Include,
MDX,
References,
TSNode,
WatchOptions,
TypeAcquisition
} from '@mnrendra/read-tsconfig'