{"id":25581,"library":"file-type-lint","title":"file-type-lint","description":"Lint file types based on content rather than extension. Works with images, audio, video, archives, and many other formats. The latest stable version is 4.0.0 (released May 2020), which uses file-type v14.3.0 internally and requires Node.js >= 10.13.0. Unlike simple extension checks, it reads the file's content to verify its actual type. Current release cadence is low, with no updates since 2020.","status":"maintenance","version":"4.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/itgalaxy/file-type-lint","tags":["javascript","mime","file","type","archive","image","img","pic","picture"],"install":[{"cmd":"npm install file-type-lint","lang":"bash","label":"npm"},{"cmd":"yarn add file-type-lint","lang":"bash","label":"yarn"},{"cmd":"pnpm add file-type-lint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"core dependency for file content type detection","package":"file-type","optional":false}],"imports":[{"note":"The package is CJS-only, no ESM or named export.","wrong":"import fileTypeLint from 'file-type-lint'","symbol":"default","correct":"const fileTypeLint = require('file-type-lint')"},{"note":"CLI command requires at least a glob or directory as argument.","wrong":"file-type-lint","symbol":"cli","correct":"npx file-type-lint ."}],"quickstart":{"code":"const fileTypeLint = require('file-type-lint');\n\nfileTypeLint({ files: '**/*' })\n  .then(result => {\n    if (result.errored) {\n      console.error('Errors found:', result.errors);\n    } else {\n      console.log('All files match their content types.');\n    }\n  })\n  .catch(error => {\n    console.error('Linting failed:', error);\n  });","lang":"javascript","description":"Shows the Node.js API usage to lint all files in the current directory by content type."},"warnings":[{"fix":"Upgrade Node.js to 10.13.0 or later.","message":"Minimum Node.js version is now 10.13.0","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Use require('file-type-lint') instead of import.","message":"Package is CommonJS only; cannot import with ES import syntax.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Consider using file-type directly or other modern alternatives.","message":"No active development; last release 2020","severity":"deprecated","affected_versions":">=4.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run npm install file-type-lint --save-dev","cause":"Package not installed or not in node_modules.","error":"Error: Cannot find module 'file-type-lint'"},{"fix":"Use require('file-type-lint') instead of import.","cause":"Using ES import syntax on a CJS module.","error":"TypeError: fileTypeLint is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}