{
 "kind": "tool",
 "slug": "jiti",
 "path": "tools/jiti/",
 "name": "jiti",
 "maker": null,
 "density": "full",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Languages, types and runtimes",
   "tools/languages-types/"
  ]
 ],
 "lead": "Run TypeScript files in Node.js without a build.",
 "chips": [
  {
   "label": "Languages, types and runtimes",
   "path": "tools/languages-types/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install jiti"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/unjs/jiti"
  },
  {
   "label": "Website",
   "href": "https://github.com/unjs/jiti#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": "Permission is hereby granted, free of charge, to any person obtaining a copy",
   "note": "MIT allows use in paid and closed-source products.",
   "src": "https://github.com/unjs/jiti/blob/main/LICENSE"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 23, 2026",
   "note": "Latest GitHub release May 5, 2026. ",
   "src": "https://github.com/unjs/jiti"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "110 projects",
   "status": "info",
   "sub": "#4 of 70 in its category",
   "note": "Dependency in 110 public GitHub projects set up for AI coding agents that we scanned (1.8%).",
   "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; card checked Nov 11, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What jiti does",
   "parts": [
    {
     "t": "prose",
     "text": "jiti is a small free JavaScript package that lets a Node.js program open TypeScript files directly, with no build step first. Tools use it to read settings files such as eslint.config.ts or tailwind.config.ts. It only runs the code; it does not check your types."
    },
    {
     "t": "h3",
     "text": "What people build with it"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "Read a TypeScript settings file",
       "text": "Your own build script or command-line helper lets people write its settings in a .ts file and still loads them from plain JavaScript.",
       "idea": false
      },
      {
       "title": "Run a one-off TypeScript script",
       "text": "Your assistant writes a small seed or cleanup script in TypeScript and runs it right away, without setting up a compiler.",
       "idea": false
      },
      {
       "title": "Let ESLint read eslint.config.ts",
       "text": "You want your lint settings in TypeScript; on Node.js, ESLint needs jiti installed in the project to open that file.",
       "idea": false
      },
      {
       "title": "Pick up edits without a restart",
       "text": "A dev server reloads a settings file after the person saves it, instead of keeping the first version it read.",
       "idea": false
      },
      {
       "title": "Mix old and new style packages",
       "text": "Your script uses packages written in the older require style and newer import style; jiti lets them load each other.",
       "idea": false
      },
      {
       "title": "Short import paths from tsconfig",
       "text": "Your code imports with shortcuts like ~/lib from tsconfig.json; jiti can follow them when you turn that option on.",
       "idea": false
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "jiti popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "67",
       "of": "/ 100",
       "l": "Gid Score, #526 overall"
      },
      {
       "n": "269M",
       "l": "downloads a week, npm"
      },
      {
       "n": "2,987",
       "l": "GitHub stars"
      },
      {
       "n": "110",
       "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 jiti is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "jiti is a dependency in 110 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (2.3% of the 4,867 JavaScript/TypeScript ones), #4 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 178; those are left out of every share on this page.",
      "The most used alternative in our scan is tsx (953 projects).",
      "Projects that use it most often also use Vitest (80.9%), tsx (58.2%), jsdom (48.2%).",
      "It is more common in projects set up for OpenClaw (9.9%) than for GitHub Copilot (1.6%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "69 projects, 2.1%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "49 projects, 1.6%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "38 projects, 1.6%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "33 projects, 9.9%",
       "v": "OpenClaw",
       "path": "agents/openclaw/"
      },
      {
       "l": "29 projects, 6.1%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      },
      {
       "l": "16 projects, 3.4%",
       "v": "OpenAI Codex",
       "path": "agents/openai-codex/"
      },
      {
       "l": "8 projects, 2.3%",
       "v": "OpenCode",
       "path": "agents/opencode/"
      },
      {
       "l": "6 projects, 4.3%",
       "v": "Kiro",
       "path": "agents/kiro/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 80.9% of its projects",
       "v": "Vitest",
       "path": "tools/vitest/"
      },
      {
       "l": "In 58.2% of its projects",
       "v": "tsx",
       "path": "tools/tsx/"
      },
      {
       "l": "In 48.2% of its projects",
       "v": "jsdom",
       "path": "tools/jsdom/"
      },
      {
       "l": "In 40.9% of its projects",
       "v": "Nx",
       "path": "tools/nx/"
      },
      {
       "l": "In 95.5% of its projects",
       "v": "TypeScript",
       "path": "tools/typescript/"
      },
      {
       "l": "In 39.1% of its projects",
       "v": "Nx JS Plugin",
       "path": "tools/nx-js/"
      },
      {
       "l": "In 37.3% of its projects",
       "v": "Express",
       "path": "tools/express/"
      },
      {
       "l": "In 37.3% of its projects",
       "v": "Nx Vite Plugin",
       "path": "tools/nx-vite/"
      }
     ]
    }
   ]
  },
  {
   "id": "profile",
   "nav": "Profile",
   "h2": "jiti in practice",
   "parts": [
    {
     "t": "h3",
     "text": "Strengths"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Mirrors import() and import.meta.resolve()",
       "v": "The README pairs each call with its native counterpart. <code>jiti.import(id)</code> works like <code>import(id)</code>, and <code>jiti.esmResolve(id)</code> works like <code>import.meta.resolve(id)</code>."
      },
      {
       "l": "Default export in one option",
       "v": "Passing <code>{ default: true }</code> to <code>jiti.import()</code> returns <code>mod?.default ?? mod</code>, so you do not have to write that fallback yourself."
      },
      {
       "l": "No dependencies, fewer transforms",
       "v": "The README calls jiti \"super slim and zero dependency\". It also says syntax detection lets jiti skip transforms that a file does not need."
      },
      {
       "l": "Transpiled files cached on disk",
       "v": "<code>fsCache</code> is on by default. It writes to <code>node_modules/.cache/jiti</code> if that folder exists, and to <code>{TMP_DIR}/jiti</code> if it does not."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Watch out for"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "The require()-style API is deprecated",
       "v": "The synchronous <code>jiti(id)</code> call, the README's stand-in for <code>require(id)</code>, appears under the heading \"CommonJS (sync &amp;amp; deprecated)\"."
      },
      {
       "l": "Every import is wrapped in a Proxy",
       "v": "<code>interopDefault</code> is on by default. The README warns that it wraps all imported modules in a Proxy, which adds \"~25-50ns overhead per property access\". For hot paths it suggests <code>interopDefault: false</code>."
      },
      {
       "l": "Behavior shifted between 2.0 and 2.1",
       "v": "jiti 2.1 turned <code>interopDefault</code> on through a new Proxy method. The maintainers warn that this may change behavior for anyone who moved to 2.0.0 earlier."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Import a TypeScript file from ESM"
    },
    {
     "t": "tabs",
     "label": "Example",
     "items": [
      {
       "tab": "Js",
       "code": "import { createJiti } from \"jiti\";\n\nconst jiti = createJiti(import.meta.url);\n\n// jiti.import(id) is similar to import(id)\nconst mod = await jiti.import(\"./path/to/file.ts\");\n\n// jiti.esmResolve(id) is similar to import.meta.resolve(id)\nconst resolvedPath = jiti.esmResolve(\"./src\");\n\n// shortcut to mod?.default ?? mod\nconst modDefault = await jiti.import(\"./path/to/file.ts\", { default: true });"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "profile",
   "h2": "More about jiti",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Head to head",
       "items": [
        {
         "text": "ts-node vs jiti",
         "note": "used together in 22 projects",
         "path": "tools/compare/ts-node-vs-jiti/"
        },
        {
         "text": "tsx vs jiti",
         "note": "used together in 64 projects",
         "path": "tools/compare/tsx-vs-jiti/"
        }
       ]
      },
      {
       "title": "Packages around it",
       "items": [
        "vitest: Test runner",
        "jsdom: DOM implementation for Node",
        "tsx: TypeScript script runner",
        "nx: Monorepo build system",
        "@nx/js: Nx JavaScript plugin",
        "vite: Dev server and bundler"
       ]
      },
      {
       "title": "More in Languages, types and runtimes",
       "path": "tools/languages-types/",
       "items": [
        {
         "text": "TypeScript",
         "path": "tools/typescript/"
        },
        {
         "text": "vue-tsc",
         "path": "tools/vue-tsc/"
        },
        {
         "text": "Cloudflare Workers Types",
         "path": "tools/cloudflare-workers-types/"
        },
        {
         "text": "mypy",
         "path": "tools/mypy/"
        },
        {
         "text": "tsconfig-paths",
         "path": "tools/tsconfig-paths/"
        },
        {
         "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": "jiti",
       "me": true,
       "facts": [
        "MIT",
        "Gid 67",
        "269M/wk"
       ]
      },
      {
       "name": "tsx",
       "why": "Pick tsx when you mainly run TypeScript scripts and servers from the terminal; it runs them with esbuild.",
       "path": "tools/tsx/",
       "facts": [
        "MIT",
        "Gid 84",
        "146M/wk"
       ]
      },
      {
       "name": "ts-node",
       "why": "Pick ts-node when you want a TypeScript runner with source map support.",
       "path": "tools/ts-node/",
       "facts": [
        "MIT",
        "Gid 81",
        "62.2M/wk"
       ]
      },
      {
       "name": "Bun",
       "why": "Pick Bun when you can switch the whole project to another JavaScript runtime that runs TypeScript itself.",
       "path": "tools/bun/",
       "facts": []
      }
     ],
     "more": "Compare jiti with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "Add jiti 2.7.0 as a dev dependency and load our settings file src/site.config.ts with createJiti(import.meta.url) and await jiti.import(path, { default: true }); keep type checking in tsc."
    },
    {
     "t": "steps",
     "items": [
      {
       "text": "Run any TypeScript file once from the terminal.",
       "code": "npx jiti ./index.ts",
       "src": "https://github.com/unjs/jiti/blob/main/README.md"
      },
      {
       "text": "Inside your own code, make one jiti instance and import .ts files through it.",
       "code": "import { createJiti } from \"jiti\";\nconst jiti = createJiti(import.meta.url);\nconst mod = await jiti.import(\"./path/to/file.ts\");\n",
       "src": "https://github.com/unjs/jiti/blob/main/README.md"
      },
      {
       "text": "Or register it once so plain node can start a .ts file (Node.js newer than 20).",
       "code": "node --import jiti/register index.ts",
       "src": "https://github.com/unjs/jiti/blob/main/README.md"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Rules for your agent"
    },
    {
     "t": "rules",
     "label": "Paste into AGENTS.md or CLAUDE.md",
     "text": "## jiti\n- In ESM, create instances with `createJiti(import.meta.url)`. The README labels the CommonJS `require(\"jiti\")` setup deprecated.\n- Load modules with `await jiti.import(id)`. The sync `jiti(id)` call is marked deprecated.\n- To get a default export, call `jiti.import(id, { default: true })` instead of writing `mod?.default ?? mod`.\n- Leave `fsCache` enabled. The README recommends it for better performance.\n- On performance-critical hot paths that read module exports very frequently, set `interopDefault: false` or `JITI_INTEROP_DEFAULT=false`.\n- Only use `jiti/register` or `node --import jiti/register` on Node.js > 20.\n- If the project relies on tsconfig `paths`, set the opt-in `tsconfigPaths: true`. To import an edited module again, set `moduleCache: false`.\n"
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "const jiti = require(\"jiti\")(__filename);  (the version 1 way)",
       "fix": "import { createJiti } from \"jiti\"; const jiti = createJiti(import.meta.url);",
       "why": "Version 2 exports createJiti; the call-the-module form is from the v1 docs."
      },
      {
       "dont": "const mod = jiti(\"./file.ts\")  (synchronous load)",
       "fix": "const mod = await jiti.import(\"./file.ts\")",
       "why": "The synchronous require-style call is marked deprecated in the README."
      },
      {
       "dont": "const config = await jiti.import(\"./config.ts\"); config.name  (reading the module, not its default export)",
       "fix": "const config = await jiti.import(\"./config.ts\", { default: true })",
       "why": "jiti.import returns the whole module like import(); the default option returns the default export."
      },
      {
       "dont": "Importing the same .ts file again after it changed and expecting new values",
       "fix": "Create the instance with { moduleCache: false } for files that change while the program runs",
       "why": "The module cache is on by default; in our run the cached instance kept returning 1 after the file said 2."
      },
      {
       "dont": "Treating a successful jiti run as proof the types are right",
       "fix": "Run tsc --noEmit (TypeScript) in CI as a separate check",
       "why": "jiti only converts and runs; our file with a number set to a string ran without an error."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "Does jiti check my TypeScript types?",
       "a": "No. It turns the file into JavaScript and runs it; a file with a type error still ran in our test. Use tsc for checks.",
       "evidence": {
        "url": "https://eslint.org/docs/latest/use/configure/configuration-files",
        "quote": "ESLint does not perform type checking on your configuration file"
       }
      },
      {
       "q": "Is the synchronous jiti() call still supported?",
       "a": "It still exists for CommonJS code, but the README marks it as deprecated; use await jiti.import() instead.",
       "evidence": {
        "url": "https://github.com/unjs/jiti/blob/main/README.md",
        "quote": "Synchronous API to replace require() (deprecated)"
       }
      },
      {
       "q": "Which tools use it?",
       "a": "The README lists Nuxt, Tailwindcss, ESLint, Docusaurus, Storybook and others.",
       "evidence": {
        "url": "https://github.com/unjs/jiti/blob/main/README.md",
        "quote": "Knip, Nitro, Nuxt, PostCSS loader, Rsbuild, Size Limit, Slidev, Tailwindcss"
       }
      },
      {
       "q": "Can it load JSX files?",
       "a": "Yes, but only when you turn the jsx option on.",
       "evidence": {
        "url": "https://github.com/unjs/jiti/blob/main/README.md",
        "quote": "JSX support (opt-in)"
       }
      },
      {
       "q": "Where are the old version 1 docs?",
       "a": "On the v1 branch of the project; the main branch is version 2.",
       "evidence": {
        "url": "https://github.com/unjs/jiti/blob/main/README.md",
        "quote": "This is the active development branch."
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm jiti"
  ],
  [
   "Category",
   "Languages, types and runtimes"
  ],
  [
   "License",
   "MIT"
  ],
  [
   "Latest version",
   "v2.7.0, May 5, 2026"
  ],
  [
   "On GitHub since",
   "June 2020"
  ],
  [
   "Gid Score",
   "67.3"
  ],
  [
   "Rank in category",
   "#4 of 70"
  ],
  [
   "GitHub",
   "unjs/jiti"
  ],
  [
   "Last change",
   "Nov 23, 2026"
  ]
 ],
 "good": [
  "It does not check types. In our run a file with a wrong type still ran; keep the TypeScript compiler for checks.",
  "It keeps a cache of converted files on disk, in node_modules/.cache/jiti or the system temp folder.",
  "Version 2 changed how default exports are merged; code written for version 1 may behave differently."
 ],
 "checked_line": "Read by AgentGid from 7 official pages, card checked Nov 11, 2026; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/unjs.png"
}