Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 3 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

file-type

Detect file type of files, streams, or data without reading full content.

Files, images and mediaNPM

GitHubWebsite

1. License

License from npm.

github.com/sindresorhus/file-type

From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error

What file-type does

Detect file type of files, streams, or data without reading full content.

file-type popularity

68 / 100
Gid Score, #510 overall
83.2M
downloads a week, npm
4,341
GitHub stars
52
agent projects use it
file-type: downloads per weeknpm, file-type 83,195,338
file-type: GitHub starssindresorhus/file-type 4,341

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How file-type is used

  • 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%).

By coding agent

44 projects, 1.3%
34 projects, 10.2%
23 projects, 0.8%
19 projects, 4.0%
8 projects, 0.3%

Often used with

In 92.3% of its projects
In 90.4% of its projects
In 94.2% of its projects
In 78.8% of its projects
In 75.0% of its projects
In 67.3% of its projects
In 67.3% of its projects
In 67.3% of its projects

More about file-type

Funding
  • 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

See all

More in Files, images and media

Alternatives

file-type This page

MITGid 6883.2M/wk

Compare file-type with another tool

Get started

Install it.

npm install file-type

No step-by-step start for file-type yet: we have not written its hand-checked card.