Registry / testing / file-type-lint

file-type-lint

JSON →
library4.0.0jsnpmunverified

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.

npm install file-type-lint
INSTALL
IMPORT
SIG · FILE-TYPE-LINT
F
file-type-lint
testingjavascriptv4.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const fileTypeLint = require('file-type-lint')
import fileTypeLint from 'file-type-lint'
The package is CJS-only, no ESM or named export.
cli
npx file-type-lint .
file-type-lint
CLI command requires at least a glob or directory as argument.

Shows the Node.js API usage to lint all files in the current directory by content type.

const fileTypeLint = require('file-type-lint'); fileTypeLint({ files: '**/*' }) .then(result => { if (result.errored) { console.error('Errors found:', result.errors); } else { console.log('All files match their content types.'); } }) .catch(error => { console.error('Linting failed:', error); });
Debug
Known issues
breakingMinimum Node.js version is now 10.13.0
fix
Upgrade Node.js to 10.13.0 or later.
affects: >=4.0.0
gotchaPackage is CommonJS only; cannot import with ES import syntax.
fix
Use require('file-type-lint') instead of import.
affects: >=4.0.0
deprecatedNo active development; last release 2020
fix
Consider using file-type directly or other modern alternatives.
affects: >=4.0.0
Errors
Common errors & fixes
Error: Cannot find module 'file-type-lint'
Package not installed or not in node_modules.
fix
Run npm install file-type-lint --save-dev
TypeError: fileTypeLint is not a function
Using ES import syntax on a CJS module.
fix
Use require('file-type-lint') instead of import.
Upgrade
Version history
4.0.0latest on npm
Audit
Dependencies
file-typerequiredcore dependency for file content type detection
Agent activity
2 hits · last 30 days
node
2
Resources
file-type-lint — npm install file-type-lint · libregistry