# file-type — card for AI agents

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

Category: Files, images and media · npm package `file-type` · latest version 22.3.0 (checked 2026-11-01)
Install: `npm install file-type`
License: MIT (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Numbers (AgentGid data)
- Gid Score: 67.6 (#510 of all tools, 31 of 281 in its category)
- Used in 52 public projects set up for AI coding agents (0.8%)
- Downloads last week: 83,195,338 (as of 2026-11-24), +42.5% over 4 weeks
- GitHub stars: 4,341 (as of 2026-11-24)
- Last push: 2026-11-14

## Often used with
Vitest 92.3%, tsx 90.4%, Zod 94.2%, dotenv 78.8%, ws 75.0%, Express 67.3%

## Links
- AgentGid page: https://agentgid.com/tools/file-type/
- Homepage: https://github.com/sindresorhus/file-type#readme
- Repository: https://github.com/sindresorhus/file-type

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
