{
 "kind": "tool",
 "slug": "file-type",
 "path": "tools/file-type/",
 "name": "file-type",
 "maker": null,
 "density": "basic",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Files, images and media",
   "tools/files-media/"
  ]
 ],
 "lead": "Detect file type of files, streams, or data without reading full content.",
 "chips": [
  {
   "label": "Files, images and media",
   "path": "tools/files-media/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install file-type"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/sindresorhus/file-type"
  },
  {
   "label": "Website",
   "href": "https://github.com/sindresorhus/file-type#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/sindresorhus/file-type"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 14, 2026",
   "note": "Latest GitHub release Oct 29, 2026. ",
   "src": "https://github.com/sindresorhus/file-type"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "52 projects",
   "status": "info",
   "sub": "#18 of 281 in its category",
   "note": "Dependency in 52 public GitHub projects set up for AI coding agents that we scanned (0.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.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What file-type does",
   "parts": [
    {
     "t": "prose",
     "text": "Detect file type of files, streams, or data without reading full content."
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "file-type popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "68",
       "of": "/ 100",
       "l": "Gid Score, #510 overall"
      },
      {
       "n": "83.2M",
       "l": "downloads a week, npm"
      },
      {
       "n": "4,341",
       "l": "GitHub stars"
      },
      {
       "n": "52",
       "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 file-type is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "file-type is a dependency in 52 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (1.1% of the 4,867 JavaScript/TypeScript ones), #18 of 281 in files, images and media.",
      "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 107; those are left out of every share on this page.",
      "Projects that use it most often also use Vitest (92.3%), tsx (90.4%), Zod (94.2%).",
      "It is more common in projects set up for OpenClaw (10.2%) than for Cursor (0.3%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "44 projects, 1.3%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "34 projects, 10.2%",
       "v": "OpenClaw",
       "path": "agents/openclaw/"
      },
      {
       "l": "23 projects, 0.8%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "19 projects, 4.0%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      },
      {
       "l": "8 projects, 0.3%",
       "v": "Cursor",
       "path": "agents/cursor/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 92.3% of its projects",
       "v": "Vitest",
       "path": "tools/vitest/"
      },
      {
       "l": "In 90.4% of its projects",
       "v": "tsx",
       "path": "tools/tsx/"
      },
      {
       "l": "In 94.2% of its projects",
       "v": "Zod",
       "path": "tools/zod/"
      },
      {
       "l": "In 78.8% of its projects",
       "v": "dotenv",
       "path": "tools/dotenv/"
      },
      {
       "l": "In 75.0% of its projects",
       "v": "ws",
       "path": "tools/ws/"
      },
      {
       "l": "In 67.3% of its projects",
       "v": "Express",
       "path": "tools/express/"
      },
      {
       "l": "In 67.3% of its projects",
       "v": "jiti",
       "path": "tools/jiti/"
      },
      {
       "l": "In 67.3% of its projects",
       "v": "JSZip",
       "path": "tools/jszip/"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "usage",
   "h2": "More about file-type",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Funding",
       "path": "tools/funding/",
       "items": [
        "GitHub Sponsors: https://github.com/sindresorhus",
        "GitHub Sponsors: https://github.com/Borewit",
        "Own page: https://github.com/sindresorhus/file-type?sponsor=1",
        "186 GitHub sponsors"
       ]
      },
      {
       "title": "More in Files, images and media",
       "path": "tools/files-media/",
       "items": [
        {
         "text": "Sharp",
         "path": "tools/sharp/"
        },
        {
         "text": "Pillow",
         "path": "tools/pillow/"
        },
        {
         "text": "Nodemailer",
         "path": "tools/nodemailer/"
        },
        {
         "text": "jsPDF",
         "path": "tools/jspdf/"
        },
        {
         "text": "SheetJS",
         "path": "tools/xlsx/"
        },
        {
         "text": "qrcode (JavaScript)",
         "path": "tools/qrcode-npm/"
        },
        {
         "text": "JSZip",
         "path": "tools/jszip/"
        },
        {
         "text": "PDF.js",
         "path": "tools/pdfjs-dist/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "file-type",
       "me": true,
       "facts": [
        "MIT",
        "Gid 68",
        "83.2M/wk"
       ]
      }
     ],
     "more": "Compare file-type with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "install",
     "intro": "Install it.",
     "code": "npm install file-type"
    },
    {
     "t": "gap",
     "text": "No step-by-step start for file-type yet: we have not written its hand-checked card."
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm file-type"
  ],
  [
   "Category",
   "Files, images and media"
  ],
  [
   "License",
   "MIT"
  ],
  [
   "Gid Score",
   "67.6"
  ],
  [
   "Rank in category",
   "#18 of 281"
  ],
  [
   "GitHub",
   "sindresorhus/file-type"
  ],
  [
   "Last change",
   "Nov 14, 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/sindresorhus.png"
}