HTML Input File Accept Attribute Checker

JSON →
library 2.2.5 ·javascript
verified May 27, 2026

attr-accept is a lightweight JavaScript utility that implements the logic of the HTML5 `<input type="file">` `accept` attribute. It provides a function to programmatically check if a given `File` object matches the criteria specified by an `accept` string, which can include MIME types (e.g., `image/*`, `application/pdf`), file extensions (e.g., `.jpg`, `.png`), and wildcards. The current stable version is 2.2.5. The library maintains a steady, though not rapid, release cadence, primarily focusing on bug fixes and minor improvements. Its key differentiator is providing a robust, standalone, and browser-compatible implementation of a browser's native file acceptance logic, making it suitable for custom file upload components, especially in libraries like react-dropzone.

total hits 17
actors 6 distinct systems
last hit 5d ago MetaBot
MetaBot
4
ByteDance
3
GPTBot
2
Script
1

top countries 🇩🇪 Germany · 🇺🇸 United States · 🇸🇬 Singapore · 🇨🇦 Canada