@visulima/tsconfig
v1.0.12
Published
Find and/or parse the tsconfig.json file from a directory path.
Downloads
2,694
Maintainers
Readme
@visulima/fs, @visulima/path, jsonc-parser and resolve-pkg-maps
Install
npm install @visulima/tsconfig
yarn add @visulima/tsconfig
pnpm add @visulima/tsconfig
Usage
findTsConfig
Retrieves the TsConfig by searching for the "tsconfig.json" file from a given current working directory.
import { findTsConfig } from "@visulima/tsconfig";
const tsconfig = await findTsConfig(); // => { path: "/Users/../Projects/visulima/packages/tsconfig/tsconfig.json", config: { compilerOptions: { ... } } }
writeTsConfig
Writes the provided TypeScript configuration object to a tsconfig.json file.
import { writeTsConfig } from '@visulima/package';
writeTsConfig({ compilerOptions: { ... } }/* ,{ cwd: "./" }*/);
readTsConfig
Reads the TypeScript configuration from a tsconfig.json file.
import { readTsConfig } from "@visulima/package";
const tsconfig = await readTsConfig("/Users/../Projects/visulima/packages/tsconfig.json" /* { tscCompatible: false } */);
tscCompatible: If true, the configuration will be parsed in a way that is compatible with the TypeScript compiler.
Related
- get-tsconfig - Get the TypeScript configuration from a project.
Supported Node.js Versions
Libraries in this ecosystem make the best effort to track Node.js’ release schedule. Here’s a post on why we think this is important.
Contributing
If you would like to help take a look at the list of issues and check our Contributing guidelines.
Note: please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Credits
License
The visulima tsconfig is open-sourced software licensed under the MIT