
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
ClamAV for humans — scan any file and get back Clean, Malicious, or ScanError. No daemons. No cloud. No native bindings.
ClamAV for humans
A minimal Node.js wrapper around ClamAV that scans any file and returns a plain string: "Clean", "Malicious", or "ScanError". No daemons. No cloud. No native bindings.
npm install pompelmi
const pompelmi = require('pompelmi');
const result = await pompelmi.scan('/path/to/file.zip');
// "Clean" | "Malicious" | "ScanError"
if (result === 'Malicious') {
throw new Error('File rejected: malware detected');
}
clamscan --no-summary <filePath> as a child process and reads the exit code.No stdout parsing. No regex. No surprises.
pompelmi.scan(filePath, [options])pompelmi.scan(filePath: string, options?: { host?: string; port?: number; timeout?: number }): Promise<"Clean" | "Malicious" | "ScanError">
| Parameter | Type | Description |
|---|---|---|
filePath | string | Absolute or relative path to the file. |
options | object | Optional. Omit to use the local clamscan CLI. Pass host / port to scan via a clamd TCP socket instead. See docs/api.md for the full reference. |
Resolves to one of:
| Result | ClamAV exit code | Meaning |
|---|---|---|
"Clean" | 0 | No threats found. |
"Malicious" | 1 | A known virus or malware signature was matched. |
"ScanError" | 2 | The scan itself failed (I/O error, encrypted archive, permission denied). File status is unknown — treat as untrusted. |
Rejects with an Error in these cases:
| Condition | Error message |
|---|---|
filePath is not a string | filePath must be a string |
| File does not exist | File not found: <path> |
clamscan is not in PATH | ENOENT (from the OS) |
| ClamAV returns an unknown exit code | Unexpected exit code: N |
clamscan process is killed by a signal | Process killed by signal: <SIGNAL> |
Example — full error handling:
const pompelmi = require('pompelmi');
const path = require('path');
async function safeScan(filePath) {
try {
const result = await pompelmi.scan(path.resolve(filePath));
if (result === 'ScanError') {
// The scan could not complete — treat the file as untrusted.
console.warn('Scan incomplete, rejecting file as precaution.');
return null;
}
return result; // "Clean" or "Malicious"
} catch (err) {
console.error('Scan failed:', err.message);
return null;
}
}
If ClamAV runs in a Docker container (or anywhere on the network), pass host and port — everything else stays the same.
const result = await pompelmi.scan('/path/to/upload.zip', {
host: '127.0.0.1',
port: 3310,
});
See docs/docker.md for the docker-compose.yml snippet and first-boot notes.
These modules are not part of the public npm API but are used internally to set up the ClamAV environment on a fresh machine.
ClamAVInstaller()Installs ClamAV using the platform's native package manager. Skips silently if ClamAV is already installed.
ClamAVInstaller(): Promise<string>
| Platform | Package manager | Command |
|---|---|---|
| macOS | Homebrew | brew install clamav |
| Linux | apt-get | sudo apt-get install -y clamav clamav-daemon |
| Windows | Chocolatey | choco install clamav -y |
updateClamAVDatabase()Downloads or updates the ClamAV virus definition database by running freshclam. Skips if main.cvd is already present on disk.
updateClamAVDatabase(): Promise<string>
freshclam exits with a non-zero code or if spawning fails.| Platform | Database path |
|---|---|
| macOS | /usr/local/share/clamav/main.cvd |
| Linux | /var/lib/clamav/main.cvd |
| Windows | C:\ProgramData\ClamAV\main.cvd |
| OS | ClamAV install | DB path checked |
|---|---|---|
| macOS | brew install clamav | /usr/local/share/clamav/main.cvd |
| Linux | apt-get install clamav | /var/lib/clamav/main.cvd |
| Windows | choco install clamav -y | C:\ProgramData\ClamAV\main.cvd |
ClamAV must be installed on the host system. pompelmi does not bundle or download it.
# macOS
brew install clamav && freshclam
# Linux (Debian / Ubuntu)
sudo apt-get install -y clamav clamav-daemon && sudo freshclam
# Windows (Chocolatey)
choco install clamav -y
npm test
The test suite has two parts:
test/unit.test.js) — run with Node's built-in test runner. Mock cross-spawn and platform dependencies; no ClamAV installation required.test/scan.test.js) — spawn real clamscan processes against EICAR test files. Skipped automatically if clamscan is not found in PATH.git checkout -b feat/your-change.npm test to verify.main.Please read CODE_OF_CONDUCT.md before contributing.
To report a vulnerability, see SECURITY.md.
ISC — © pompelmi contributors
FAQs
ClamAV for humans — scan any file and get back Clean, Malicious, or ScanError. No daemons. No cloud. No native bindings.
The npm package pompelmi receives a total of 2,287 weekly downloads. As such, pompelmi popularity was classified as popular.
We found that pompelmi demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.