Detect the file type of a Buffer, Uint8Array, or ArrayBuffer. This package identifies file types based on their magic numbers (initial bytes) ensuring accurate detection, crucial for security and data handling. It supports a wide range of file formats, providing metadata like MIME type and file extension. file-type is essential for validating uploaded files, routing data streams, and ensuring proper file processing in Node.js and browser environments, enhancing application reliability and security.
The file-type npm package has been actively maintained since its initial release in April 2014. Release frequency was highest in 2014-2015 and 2020, with several months seeing multiple version updates. The package has had consistent updates on a monthly cadence with some months of no releases over the years. The latest data shows no releases in the last three months. The most recent version was released in May 2025.
NPM package "file-type" downloads show a generally increasing trend from March 2024 (64.7 million) to July 2025 (125.8 million). August 2025 saw a slight decrease to 118.3 million. September 2025 downloads are incomplete, totaling 27 million as of today.