file-guardian
v1.0.0
Published
Zero-dependency file security scanner for Node.js — detect malware, suspicious patterns, and validate uploads
Maintainers
Readme
File Guardian 🔒
Zero-dependency file security scanner for Node.js.
Why
AI agents, web apps, and file-sharing platforms process user uploads daily.
One malicious file = disaster. File Guardian catches threats before they reach your system.
Install
npm install file-guardianUsage
const { scan } = require('file-guardian');
// Scan a file path
const result = scan('/uploads/report.pdf');
// { safe: true, threats: [], metadata: { size, sha256, ext } }
// Scan a buffer
const result = scan(buffer);
// { safe: false, threats: ['Binary signature: exe'], metadata: {...} }What It Detects
- Executable signatures (EXE, ELF, Mach-O, PHP)
- Dangerous file extensions
- Embedded scripts (XSS, eval, system calls)
- Path traversal & null byte injection
- Oversized / empty files
