Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

get-tsconfig

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-tsconfig

Find and parse the tsconfig.json file from a directory path

  • 4.8.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13M
decreased by-2.41%
Maintainers
1
Weekly downloads
 
Created

What is get-tsconfig?

The get-tsconfig npm package is a utility for finding and reading TypeScript configuration files (tsconfig.json). It simplifies the process of locating the tsconfig.json file and parsing its contents, making it easier to work with TypeScript configurations programmatically.

What are get-tsconfig's main functionalities?

Find the tsconfig.json file

This feature allows you to locate the tsconfig.json file in your project. The `find` function searches for the tsconfig.json file starting from the current directory and moving up the directory tree until it finds one.

const { find } = require('get-tsconfig');
const tsconfigPath = find();
console.log(tsconfigPath);

Read and parse the tsconfig.json file

This feature allows you to read and parse the contents of the tsconfig.json file. The `load` function returns the parsed JSON content of the tsconfig.json file, making it easy to access and manipulate the TypeScript configuration programmatically.

const { load } = require('get-tsconfig');
const tsconfig = load();
console.log(tsconfig);

Specify a custom path to the tsconfig.json file

This feature allows you to specify a custom path to the tsconfig.json file. The `load` function can take a file path as an argument, enabling you to load and parse a tsconfig.json file from a specific location.

const { load } = require('get-tsconfig');
const tsconfig = load('/path/to/your/tsconfig.json');
console.log(tsconfig);

Other packages similar to get-tsconfig

Keywords

FAQs

Package last updated on 12 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc