{"id":26530,"library":"tsconfig-extends","title":"tsconfig-extends","description":"Load TypeScript compiler options from tsconfig.json, fully resolving the \"extends\" chain. v1.0.1 is the latest stable release (no further updates since 2017). Unlike ts-node or tsc built-in resolution, this is a standalone utility for programmatic usage. It resolves inheritance from both relative paths and node_modules packages. Only provides synchronous API. Minimalist: no caching, no validation beyond what TypeScript enforces. Ships TypeScript declarations. For Node.js >= 4.","status":"maintenance","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/ikatyang/tsconfig-extends","tags":["javascript","compiler-options","extends","tsconfig","typescript"],"install":[{"cmd":"npm install tsconfig-extends","lang":"bash","label":"npm"},{"cmd":"yarn add tsconfig-extends","lang":"bash","label":"yarn"},{"cmd":"pnpm add tsconfig-extends","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM import is the standard. CJS require works but destructure the module.","wrong":"const load_file_sync = require('tsconfig-extends').load_file_sync","symbol":"load_file_sync","correct":"import { load_file_sync } from 'tsconfig-extends'"},{"note":"Not a default export; named exports only.","wrong":"import tsconfig from 'tsconfig-extends'; tsconfig.load_config_sync(...)","symbol":"load_config_sync","correct":"import { load_config_sync } from 'tsconfig-extends'"},{"note":"TypeScript type only – do not use as runtime value. Import with `import type` for clarity.","wrong":"import { TSConfig } from 'tsconfig-extends'","symbol":"TSConfig","correct":"import type { TSConfig } from 'tsconfig-extends'"}],"quickstart":{"code":"import { load_file_sync } from 'tsconfig-extends';\nimport * as path from 'path';\n\nconst tsconfigPath = path.resolve('./tsconfig.json');\ntry {\n  const options = load_file_sync(tsconfigPath);\n  console.log('Compiler options:', options);\n} catch (err) {\n  console.error('Failed to load tsconfig:', err);\n}","lang":"typescript","description":"Load compiler options from tsconfig.json with extends resolution, handling errors."},"warnings":[{"fix":"Wrap in try/catch or validate file existence before calling.","message":"load_file_sync throws if tsconfig.json is missing or invalid JSON / TypeScript config","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Cache result manually if calling multiple times with same path.","message":"The library does not cache results; repeated calls re-read and re-resolve the entire extends chain","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Consider using @typescript-eslint/parser's built-in tsconfig resolution or tsconfig-paths for advanced needs.","message":"Project is in maintenance mode; no updates since 2017, no support for newer TypeScript features (e.g., references, path mapping from tsconfig)","severity":"deprecated","affected_versions":">=1.0"}],"env_vars":null,"search_vec":"'2017':25 '4':73 'api':58 'beyond':64 'built':33 'built-in':32 'cach':61 'chain':14 'compil':6,76 'compiler-opt':75 'declar':70 'enforc':67 'extend':3,13,78 'fulli':10 'inherit':46 'javascript':74 'latest':18 'load':4 'minimalist':59 'modul':53 'node':29,52 'node.js':72 'option':7,77 'packag':54 'path':50 'programmat':42 'provid':56 'relat':49 'releas':20 'resolut':35 'resolv':11,45 'ship':68 'sinc':24 'stabl':19 'standalon':39 'synchron':57 'ts':28 'ts-node':27 'tsc':31 'tsconfig':2,79 'tsconfig-extend':1 'tsconfig.json':9 'typescript':5,66,69,80 'unlik':26 'updat':23 'usag':43 'util':40 'v1.0.1':15 'valid':63","created_at":"2026-05-01T13:50:27.340351+00:00","updated_at":"2026-05-01T13:50:27.340351+00:00","problems":[{"fix":"Use import { load_file_sync } from 'tsconfig-extends' or const { load_file_sync } = require('tsconfig-extends');","cause":"CommonJS require without destructuring vs named export","error":"TypeError: load_file_sync is not a function"},{"fix":"Run: npm install tsconfig-extends","cause":"Package not installed","error":"Error: Cannot find module 'tsconfig-extends'"},{"fix":"Use require() or set \"type\": \"module\" in package.json or use dynamic import.","cause":"Using ESM import in a CommonJS environment (Node < 13 or without \"type\":\"module\")","error":"SyntaxError: Unexpected token 'export'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/ikatyang/tsconfig-extends","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/tsconfig-extends","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}