{
 "kind": "tool",
 "slug": "tsconfig-paths",
 "path": "tools/tsconfig-paths/",
 "name": "tsconfig-paths",
 "maker": null,
 "density": "profile",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Languages, types and runtimes",
   "tools/languages-types/"
  ]
 ],
 "lead": "Module resolution utility that loads Node.js modules according to TypeScript path mappings.",
 "chips": [
  {
   "label": "Languages, types and runtimes",
   "path": "tools/languages-types/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install tsconfig-paths"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/dividab/tsconfig-paths"
  },
  {
   "label": "Website",
   "href": "https://github.com/dividab/tsconfig-paths#readme"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "MIT",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": null,
   "note": "License from npm.",
   "src": "https://github.com/dividab/tsconfig-paths"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Feb 23, 2026",
   "note": "",
   "src": "https://github.com/dividab/tsconfig-paths"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "41 projects",
   "status": "info",
   "sub": "#8 of 70 in its category",
   "note": "Dependency in 41 public GitHub projects set up for AI coding agents that we scanned (0.7%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Install only",
   "status": "info",
   "sub": null,
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What tsconfig-paths does",
   "parts": [
    {
     "t": "prose",
     "text": "tsconfig-paths makes plain Node and ts-node honor the <code>paths</code> aliases in <code>tsconfig.json</code> at run time. You preload <code>tsconfig-paths/register</code>, and it patches Node's module loading so aliased imports resolve to real files."
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "tsconfig-paths popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "66",
       "of": "/ 100",
       "l": "Gid Score, #641 overall"
      },
      {
       "n": "165M",
       "l": "downloads a week, npm"
      },
      {
       "n": "1,906",
       "l": "GitHub stars"
      },
      {
       "n": "41",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How tsconfig-paths is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "tsconfig-paths is a dependency in 41 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (0.8% of the 4,867 JavaScript/TypeScript ones), #8 of 70 in languages, types and runtimes.",
      "Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 159; those are left out of every share on this page.",
      "The most used alternative in our scan is ts-node (295 projects).",
      "Projects that use it most often also use ts-node (75.6%), Jest (63.4%), dotenv (56.1%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "26 projects, 0.8%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "23 projects, 0.9%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "22 projects, 0.7%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 75.6% of its projects",
       "v": "ts-node",
       "path": "tools/ts-node/"
      },
      {
       "l": "In 63.4% of its projects",
       "v": "Jest",
       "path": "tools/jest/"
      },
      {
       "l": "In 56.1% of its projects",
       "v": "dotenv",
       "path": "tools/dotenv/"
      },
      {
       "l": "In 63.4% of its projects",
       "v": "Prettier",
       "path": "tools/prettier/"
      },
      {
       "l": "In 46.3% of its projects",
       "v": "RxJS",
       "path": "tools/rxjs/"
      },
      {
       "l": "In 97.6% of its projects",
       "v": "TypeScript",
       "path": "tools/typescript/"
      },
      {
       "l": "In 43.9% of its projects",
       "v": "SuperTest",
       "path": "tools/supertest/"
      },
      {
       "l": "In 41.5% of its projects",
       "v": "Testing Library",
       "path": "tools/testing-library/"
      }
     ]
    }
   ]
  },
  {
   "id": "profile",
   "nav": "Profile",
   "h2": "tsconfig-paths in practice",
   "parts": [
    {
     "t": "h3",
     "text": "Strengths"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "One flag, no code changes",
       "v": "Add <code>-r tsconfig-paths/register</code> to node or ts-node. It reads <code>paths</code> from <code>tsconfig.json</code> or <code>jsconfig.json</code> and maps aliased requires to files Node can load."
      },
      {
       "l": "Works with any preloading command",
       "v": "The README covers node, ts-node, mocha and a VSCode <code>launch.json</code> setup. It says any command with a <code>--require</code>-like option should work."
      },
      {
       "l": "Bootstrap for compiled output",
       "v": "You can call <code>register</code> yourself with an explicit <code>baseUrl</code> and <code>paths</code>. The README suggests this when <code>tsc</code> wrote output to a directory with no <code>tsconfig.json</code>."
      },
      {
       "l": "Matching API for tool authors",
       "v": "<code>createMatchPath</code> takes <code>baseUrl</code> and <code>paths</code> as written in tsconfig and returns a resolver function. Async variants exist, and <code>matchFromAbsolutePaths</code> is a lower-level version for pre-resolved mappings."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Watch out for"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "It patches Node's module loader",
       "v": "<code>register</code> changes Node's module loading for the whole process. It returns a function that restores the original loader, which you call when registration is no longer needed."
      },
      {
       "l": "Config is found from the working directory",
       "v": "If no explicit params or <code>TS_NODE_PROJECT</code> are given, the README says <code>tsconfig.json</code> is resolved from the current working directory. Starting the process from another folder can change which config is used."
      },
      {
       "l": "Not for Webpack",
       "v": "Webpack builds are handled by a separate package. The README points to tsconfig-paths-webpack-plugin."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Register paths explicitly for compiled output"
    },
    {
     "t": "tabs",
     "label": "Example",
     "items": [
      {
       "tab": "Js",
       "code": "const tsConfig = require(\"./tsconfig.json\");\nconst tsConfigPaths = require(\"tsconfig-paths\");\n\nconst baseUrl = \"./\"; // Either absolute or relative path. If relative it's resolved to current working directory.\nconst cleanup = tsConfigPaths.register({\n  baseUrl,\n  paths: tsConfig.compilerOptions.paths,\n});\n\n// When path registration is no longer needed\ncleanup();"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "profile",
   "h2": "More about tsconfig-paths",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Packages around it",
       "items": [
        "ts-node: TypeScript execution for Node",
        "prettier: Code formatter",
        "dotenv: Env vars from .env files",
        "jest: Test runner",
        "axios: HTTP client",
        "typescript: TypeScript compiler"
       ]
      },
      {
       "title": "More in Languages, types and runtimes",
       "path": "tools/languages-types/",
       "items": [
        {
         "text": "TypeScript",
         "path": "tools/typescript/"
        },
        {
         "text": "tsx",
         "path": "tools/tsx/"
        },
        {
         "text": "vue-tsc",
         "path": "tools/vue-tsc/"
        },
        {
         "text": "Cloudflare Workers Types",
         "path": "tools/cloudflare-workers-types/"
        },
        {
         "text": "mypy",
         "path": "tools/mypy/"
        },
        {
         "text": "CFFI",
         "path": "tools/cffi/"
        },
        {
         "text": "pycparser",
         "path": "tools/pycparser/"
        },
        {
         "text": "type-fest",
         "path": "tools/type-fest/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "tsconfig-paths",
       "me": true,
       "facts": [
        "MIT",
        "Gid 66",
        "165M/wk"
       ]
      },
      {
       "name": "ts-node",
       "why": "TypeScript execution environment for Node.js with source map support.",
       "path": "tools/ts-node/",
       "facts": [
        "MIT",
        "Gid 81",
        "62.2M/wk"
       ]
      },
      {
       "name": "jiti",
       "why": "Runtime TypeScript and ESM support for Node.js without build steps.",
       "path": "tools/jiti/",
       "facts": [
        "MIT",
        "Gid 67",
        "269M/wk"
       ]
      }
     ],
     "more": "Compare tsconfig-paths with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "install",
     "intro": "Install it.",
     "code": "npm install tsconfig-paths"
    },
    {
     "t": "h3",
     "text": "Rules for your agent"
    },
    {
     "t": "rules",
     "label": "Paste into AGENTS.md or CLAUDE.md",
     "text": "## tsconfig-paths\n- Install as a dev dependency: `npm install --save-dev tsconfig-paths`.\n- Run with `node -r tsconfig-paths/register main.js` or `ts-node -r tsconfig-paths/register main.ts`.\n- For mocha, use `mocha -r ts-node/register -r tsconfig-paths/register \"test/**/*.ts\"`. Use `-r`, not `--compiler`, and include a `.ts` glob.\n- If the tsconfig is not in the working directory, set `TS_NODE_PROJECT` or pass `--project`. Use `TS_NODE_BASEURL=./dist` to point `baseUrl` at compiled output.\n- When running `tsc` output from a directory without `tsconfig.json`, write a bootstrap script that calls `register({ baseUrl, paths })` and preload it with `node -r`.\n- Call the cleanup function returned by `register` when path registration is no longer needed.\n- Do not use this package for Webpack builds. Use tsconfig-paths-webpack-plugin instead.\n"
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm tsconfig-paths"
  ],
  [
   "Category",
   "Languages, types and runtimes"
  ],
  [
   "License",
   "MIT"
  ],
  [
   "Latest version",
   "4.2.0, March 29, 2023"
  ],
  [
   "On GitHub since",
   "December 2016"
  ],
  [
   "Gid Score",
   "65.6"
  ],
  [
   "Rank in category",
   "#8 of 70"
  ],
  [
   "GitHub",
   "dividab/tsconfig-paths"
  ],
  [
   "Last change",
   "Feb 23, 2026"
  ]
 ],
 "good": [],
 "checked_line": "From the package registry, GitHub and our scan of public agent projects; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/dividab.png"
}