nodejs-eicar is a simple Node.js utility that prints or writes the EICAR test string, commonly used to test antivirus detection systems. It can be used as a command-line tool or as a module in your Node.js applications.
This package is intended for security teams, red teams, and developers who want to verify AV/EDR behavior when interacting with potentially suspicious Node.js packages — a growing supply chain risk.
This project uses the official EICAR test string, which is not malicious and is recognized by antivirus software as a safe test pattern.
It is provided strictly for testing and educational purposes. Use only in environments you own or have permission to test.
Install globally via npm:
npm install -g nodejs-eicarAfter installation, you can run:
eicar-printThis will print the EICAR test string directly to your console.
You can also use nodejs-eicar in your Node.js scripts:
const Eicar = require('nodejs-eicar');
const eicar = new Eicar();
// Print the EICAR string
eicar.print();
// Write the EICAR string to a file
eicar.writeToFile('eicar.txt');Creates a new Eicar instance with a .string property containing the EICAR test string.
Prints the EICAR string to the console. Returns true on success or false on error.
Appends the EICAR string to the given file path. Returns true on success or false on failure.
nodejs-eicar/
├── index.js # Core logic
├── cli.js # CLI interface (eicar-print)
├── package.json
├── README.md
└── LICENSE
- Test AV/EDR reactions to
npminstalls and CLI tools - Simulate detection events in safe, controlled environments
- Validate security controls and monitoring pipelines
MIT License — see LICENSE
Created by Khalid Al-Amri — for use in cybersecurity labs and secure dev environments.