npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

grim-reaper

v1.0.35

Published

Grim: Unified Data Protection Ecosystem. When data death comes knocking, Grim ensures resurrection is just a command away. License management, auto backups, highly compressed backups, multi-algorithm compression, content-based deduplication, smart storage

Readme

Grim Reaper 🗡️ JavaScript/Node.js Package

npm Downloads License: BBL

When data death comes knocking, Grim ensures resurrection is just a command away.

🔥 Latest Release v1.0.35 - PRODUCTION HARDENING & MONITORING EXCELLENCE

🚀 CRITICAL UPDATE: Advanced production monitoring, installation fixes, and enterprise infrastructure hardening!

🎯 v1.0.35 - July 27, 2025 Production Enhancements

🔧 JavaScript Package Critical Fixes

FIXED: latest.tar.gz download and extraction logic with proper strip: 2 handling
ADDED: Missing environment variables - GRIM_LICENSE="FREE" and GRIM_REAPER="FALSE"
ENHANCED: Permission-aware installation with /root/, $HOME, and local fallbacks
IMPLEMENTED: GRIM_REAPER="TRUE" mode for selective updates preserving sensitive data
IMPROVED: Installation path detection with proper permission checking
ADDED: Version tracking from manifest.tsk integration

🛡️ Infrastructure Monitoring Revolution (July 26-27)

Complete Monitoring System: Automated cron jobs monitoring 262+ Flask routes across 7 domains
Professional Email Alerts: Zeptomail integration with HTML emails to [email protected] and [email protected]
Comprehensive Coverage: 66 checks per run including DNS, SSL, services, APIs, and performance
Advanced Status Checker: 456-line monitoring script with color-coded output and detailed logging
Automated Scheduling: Every 15 minutes via cron (96 daily cycles, 672 weekly checks)
SSL Certificate Monitoring: 30-day expiration warnings and validation across 4 certificates

⚡ Production Infrastructure Hardening

Multi-Domain Monitoring: grim.so, get.grim.so, init.grim.so, up.grim.so, rip.grim.so, rp.grim.so
Service Port Verification: Ports 4746, 4745, 4749, 80, 443 continuous monitoring
API Endpoint Validation: Core APIs, admin panels, authentication, billing, storage systems
Performance Metrics: Load time analysis with configurable thresholds
Log Management: Daily rotation with structured logging in /opt/reaper/logs/
Professional Reporting: Detailed status emails only sent when issues detected

🔗 Enterprise API Monitoring Coverage

Core Systems: Installation, documentation, command references, health checks
Grim Hell Storage: Upload, list, and migration endpoints monitoring
Authentication System: Login, registration, profile management validation
Admin Dashboard: Storage, billing, monitoring, user management oversight
Affiliate Platform: Underworld system with dynamic affiliate tracking
Scythe Vendor System: Dashboard, registration, and vendor management
Billing Integration: Stripe configuration, plan validation, license checks

🎯 Package Installation Improvements

Smart Path Detection: Automatic fallback from /root/$HOME → local directory
Permission Validation: Comprehensive write permission checking before installation
Error Handling: Clear error messages with actionable troubleshooting steps
Environment Setup: Complete environment variable configuration including license settings
Selective Updates: REAPER mode preserves databases, logs, configs, and license keys
Backup Protection: Automatic backup of sensitive data during updates

📊 Monitoring & Alert Statistics

  • 7 Domains: Complete subdomain infrastructure coverage
  • 66 Checks: Comprehensive testing per monitoring cycle
  • 96 Daily Runs: Every 15 minutes automated monitoring
  • 4 SSL Certificates: Proactive expiration monitoring
  • 262+ Flask Routes: Complete application endpoint coverage
  • 0 False Positives: Smart failure detection algorithms

🔧 Development & Deployment

MIT License Integration: PHP package properly licensed for open source distribution
Packagist Deployment: Version 1.0.32 successfully deployed to Composer registry
Go Package Fixes: Build system improvements and proper tagging
Analytics Infrastructure: Comprehensive deployment and monitoring integration
Status Verification: Multi-layer health checking with professional reporting

🎉 Status: PRODUCTION HARDENED - Enterprise monitoring and bulletproof installation achieved!

Upgrade NOW: npm install -g grim-reaper


Enterprise-grade data protection platform with AI-powered backup decisions, military-grade encryption, multi-algorithm compression, content-based deduplication, real-time monitoring, and automated threat response. Now with production-grade monitoring and bulletproof installation logic.


Enterprise-grade data protection platform with AI-powered backup decisions, military-grade encryption, multi-algorithm compression, content-based deduplication, real-time monitoring, and automated threat response.

🚀 Quick Install

npm install -g grim-reaper

🎯 Quick Start

const GrimReaper = require('grim-reaper');

// Initialize Grim Reaper
const grim = new GrimReaper();

// Quick backup
await grim.backup('/important/data');

// Start monitoring
await grim.monitor('/var/log');

// Health check
const health = await grim.healthCheck();
console.log(`System Status: ${health.status}`);

📋 Complete Command Reference

All commands use the unified Grim Reaper command structure:

🤖 AI & Machine Learning

# AI Decision Engine
grim ai-decision init                    # Initialize AI decision engine
grim ai-decision analyze                 # Analyze files for intelligent backup decisions
grim ai-decision backup-priority         # Determine backup priorities using AI
grim ai-decision storage-optimize        # Optimize storage allocation with AI
grim ai-decision resource-manage         # Manage system resources intelligently
grim ai-decision validate                # Validate AI models and decisions
grim ai-decision report                  # Generate AI analysis report
grim ai-decision config                  # Configure AI parameters
grim ai-decision status                  # Check AI engine status

# AI Integration
grim ai init                             # Initialize AI integration framework
grim ai install                          # Install AI dependencies (TensorFlow/PyTorch)
grim ai train                            # Train AI models on your data
grim ai predict                          # Generate predictions from models
grim ai analyze                          # Analyze data patterns
grim ai optimize                         # Optimize AI performance
grim ai monitor                          # Monitor AI operations
grim ai validate                         # Validate model accuracy
grim ai report                           # Generate integration report
grim ai config                           # Configure AI integration
grim ai status                           # Check integration status

# AI Production Deployment
grim ai-deploy deploy                    # Deploy AI models to production
grim ai-deploy test                      # Run automated deployment tests
grim ai-deploy rollback                  # Rollback to previous version
grim ai-deploy monitor                   # Monitor deployed models
grim ai-deploy health                    # Check deployment health
grim ai-deploy backup                    # Backup current deployment
grim ai-deploy restore                   # Restore from backup
grim ai-deploy status                    # Check deployment status

# AI Training
grim ai-train analyze                    # Analyze training data
grim ai-train train                      # Train base models
grim ai-train predict                    # Generate predictions
grim ai-train cluster                    # Perform clustering analysis
grim ai-train extract                    # Extract features from data
grim ai-train validate                   # Validate model performance
grim ai-train report                     # Generate training report
grim ai-train neural                     # Train neural networks
grim ai-train ensemble                   # Train ensemble models
grim ai-train timeseries                 # Time series analysis
grim ai-train regression                 # Train regression models
grim ai-train classify                   # Train classification models
grim ai-train config                     # Configure training parameters
grim ai-train init                       # Initialize training environment

# AI Velocity Enhancement
grim ai-turbo turbo                      # Activate turbo mode for AI
grim ai-turbo optimize                   # Optimize AI performance
grim ai-turbo benchmark                  # Run performance benchmarks
grim ai-turbo validate                   # Validate optimizations
grim ai-turbo deploy                     # Deploy optimized models
grim ai-turbo monitor                    # Monitor performance gains
grim ai-turbo report                     # Generate performance report

💾 Backup & Recovery

# Core Backup Operations
grim backup create                       # Create intelligent backup
grim backup verify                       # Verify backup integrity
grim backup list                         # List all backups

# Core Backup Engine
grim backup-core create                  # Create core backup with progress
grim backup-core verify                  # Verify backup checksums
grim backup-core restore                 # Restore from backup
grim backup-core status                  # Check backup system status
grim backup-core init                    # Initialize backup system

# Automatic Backup Daemon
grim auto-backup start                   # Start automatic backup daemon
grim auto-backup stop                    # Stop backup daemon
grim auto-backup restart                 # Restart backup daemon
grim auto-backup status                  # Check daemon status
grim auto-backup health                  # Health check with diagnostics

# Restore Operations
grim restore recover                     # Restore from backup
grim restore list                        # List available restore points
grim restore verify                      # Verify restore integrity

# Deduplication
grim dedup dedup                         # Deduplicate files
grim dedup restore                       # Restore deduplicated files
grim dedup cleanup                       # Clean orphaned chunks
grim dedup stats                         # Show deduplication statistics
grim dedup verify                        # Verify dedup integrity
grim dedup benchmark                     # Run deduplication benchmarks

📊 System Monitoring & Health

# System Monitoring
grim monitor start                       # Start system monitoring
grim monitor stop                        # Stop monitoring
grim monitor status                      # Check monitor status
grim monitor show                        # Show current metrics
grim monitor report                      # Generate monitoring report

# Health Checking
grim health check                        # Complete health check
grim health fix                          # Auto-fix detected issues
grim health report                       # Generate health report
grim health monitor                      # Continuous health monitoring

# Enhanced Health Monitoring
grim health-check check                  # Enhanced health check
grim health-check services               # Check all services
grim health-check disk                   # Check disk health
grim health-check memory                 # Check memory status
grim health-check network                # Check network health
grim health-check fix                    # Auto-fix all issues
grim health-check report                 # Detailed health report

🔒 Security & Compliance

# Security Auditing
grim audit full                          # Complete security audit
grim audit permissions                   # Audit file permissions
grim audit compliance                    # Check compliance (CIS/STIG/NIST)
grim audit backups                       # Audit backup integrity
grim audit logs                          # Audit access logs
grim audit config                        # Audit configuration security
grim audit report                        # Generate audit report

# Security Operations
grim security scan                       # Run security scan
grim security audit                      # Deep security audit
grim security fix                        # Auto-fix vulnerabilities
grim security report                     # Generate security report
grim security monitor                    # Start security monitoring

# Security Testing
grim security-testing vulnerability      # Run vulnerability tests
grim security-testing penetration        # Run penetration tests
grim security-testing compliance         # Test compliance standards
grim security-testing report             # Generate test report

# File Encryption
grim encrypt encrypt                     # Encrypt files
grim encrypt decrypt                     # Decrypt files
grim encrypt key-gen                     # Generate encryption keys
grim encrypt verify                      # Verify encryption

# File Verification
grim verify integrity                    # Verify file integrity
grim verify checksum                     # Verify checksums
grim verify signature                    # Verify digital signatures
grim verify backup                       # Verify backup integrity

# Multi-Language Scanner
grim scanner scan                        # Multi-threaded file system scan
grim scanner info                        # Get file information and summary
grim scanner hash                        # Calculate file hashes (MD5/SHA256)
grim scanner py-scan                     # Python-based security scanning
grim scanner security                    # Security vulnerability scan
grim scanner malware                     # Malware detection scan
grim scanner vulnerability               # Deep vulnerability scan
grim scanner compliance                  # Compliance verification scan
grim scanner report                      # Generate scan report

🚀 Performance & Optimization

# High-Performance Compression
grim compression compress                # Compress with Go binary (8 algorithms)
grim compression decompress              # Decompress files
grim compression benchmark               # Run compression benchmarks
grim compression optimize                # Optimize compression
grim compression analyze                 # Analyze compression potential
grim compression list                    # List compressed files
grim compression cleanup                 # Clean temporary files

# System Optimization
grim blacksmith optimize                 # System-wide optimization
grim blacksmith maintain                 # Run maintenance tasks
grim blacksmith forge                    # Create new tools
grim blacksmith list-tools               # List available tools
grim blacksmith run-tool                 # Run specific tool
grim blacksmith schedule                 # Schedule maintenance
grim blacksmith list-scheduled           # List scheduled tasks
grim blacksmith backup-tools             # Backup custom tools
grim blacksmith restore-tools            # Restore tools
grim blacksmith update-tools             # Update all tools
grim blacksmith stats                    # Show forge statistics
grim blacksmith config                   # Configure forge

# Performance Testing
grim performance-test cpu                # Test CPU performance
grim performance-test memory             # Test memory performance
grim performance-test disk               # Test disk I/O
grim performance-test network            # Test network throughput
grim performance-test full               # Run all performance tests
grim performance-test report             # Generate performance report

# System Cleanup
grim cleanup all                         # Clean everything safely
grim cleanup backups                     # Clean old backups
grim cleanup temp                        # Clean temporary files
grim cleanup logs                        # Clean old logs
grim cleanup database                    # Clean database
grim cleanup duplicates                  # Remove duplicate files
grim cleanup report                      # Preview cleanup actions

🌐 Web Services & APIs

# Web Services
grim web start                           # Start FastAPI web server
grim web stop                            # Stop all web services
grim web restart                         # Restart web server
grim web gateway                         # Start API gateway with load balancing
grim web api                             # Start API application
grim web status                          # Show web services status

# Monitoring Dashboard
grim dashboard start                     # Start web dashboard
grim dashboard stop                      # Stop dashboard
grim dashboard restart                   # Restart dashboard
grim dashboard status                    # Check dashboard status
grim dashboard config                    # Configure dashboard
grim dashboard init                      # Initialize dashboard
grim dashboard setup                     # Run setup wizard
grim dashboard logs                      # View dashboard logs

# API Gateway
grim gateway start                       # Start API gateway
grim gateway stop                        # Stop gateway
grim gateway status                      # Gateway status
grim gateway config                      # Configure gateway

☁️ Cloud & Distributed Systems

# Cloud Platform Integration
grim cloud init                          # Initialize cloud platform
grim cloud aws                           # Deploy to AWS
grim cloud azure                         # Deploy to Azure
grim cloud gcp                           # Deploy to Google Cloud
grim cloud serverless                    # Deploy serverless functions
grim cloud comprehensive                 # Full cloud deployment

# Distributed Architecture
grim distributed init                    # Initialize distributed system
grim distributed deploy                  # Deploy microservices
grim distributed scale                   # Scale services
grim distributed balance                 # Configure load balancing
grim distributed monitor                 # Monitor distributed system

# Load Balancing
grim load-balancer start                 # Start load balancer
grim load-balancer stop                  # Stop load balancer
grim load-balancer status                # Check balancer status
grim load-balancer add-server            # Add backend server
grim load-balancer remove-server         # Remove backend server

# File Transfer (Multi-Protocol)
grim transfer upload                     # Upload files to destination
grim transfer download                   # Download files from source
grim transfer resume                     # Resume interrupted transfer
grim transfer verify                     # Verify transfer integrity

🧪 Testing & Quality Assurance

# Testing Framework
grim testing run                         # Run all tests
grim testing benchmark                   # Run benchmarks
grim testing ci                          # CI/CD test suite
grim testing report                      # Generate test report

# Quality Assurance
grim qa code-review                      # Automated code review
grim qa static-analysis                  # Static code analysis
grim qa security-scan                    # Security scanning
grim qa performance-test                 # Performance testing
grim qa integration-test                 # Integration testing
grim qa report                           # Generate QA report

# User Acceptance Testing
grim user-acceptance run                 # Run acceptance tests
grim user-acceptance generate            # Generate test scenarios
grim user-acceptance validate            # Validate user workflows
grim user-acceptance report              # Generate UAT report

🔧 System Maintenance & Operations

# Central Orchestrator (Scythe)
grim scythe harvest                      # Orchestrate all operations
grim scythe analyze                      # Analyze system state
grim scythe report                       # Generate master report
grim scythe monitor                      # Monitor all operations
grim scythe status                       # Show orchestrator status
grim scythe backup                       # Orchestrated backup operations

# Logging System
grim log init                            # Initialize logging system
grim log setup                           # Setup logger configuration
grim log event                           # Log structured event
grim log metric                          # Log performance metric
grim log rotate                          # Rotate log files
grim log cleanup                         # Clean up old log files
grim log status                          # Show logging system status
grim log tail                            # Tail log file

# Configuration Management
grim config load                         # Load configuration
grim config save                         # Save configuration
grim config get                          # Get configuration value
grim config set                          # Set configuration value
grim config validate                     # Validate configuration

🟨 JavaScript/Node.js-Specific Integration

Express.js Integration

const express = require('express');
const GrimReaper = require('grim-reaper');

const app = express();
const grim = new GrimReaper();

app.post('/backup', async (req, res) => {
    const { path } = req.body;
    
    try {
        const result = await grim.backup(path);
        res.json({ status: 'success', result });
    } catch (error) {
        res.status(500).json({ status: 'error', message: error.message });
    }
});

app.get('/health', async (req, res) => {
    try {
        const health = await grim.healthCheck();
        res.json(health);
    } catch (error) {
        res.status(500).json({ status: 'error', message: error.message });
    }
});

app.listen(3000, () => {
    console.log('🗡️ Grim Reaper API server running on port 3000');
});

React.js Frontend Integration

import React, { useState, useEffect } from 'react';
import { GrimReaper } from 'grim-reaper/browser';

function GrimDashboard() {
    const [health, setHealth] = useState(null);
    const [backupStatus, setBackupStatus] = useState('idle');
    
    useEffect(() => {
        const grim = new GrimReaper();
        
        // Check health every 30 seconds
        const healthCheck = async () => {
            try {
                const status = await grim.healthCheck();
                setHealth(status);
            } catch (error) {
                console.error('Health check failed:', error);
            }
        };
        
        healthCheck();
        const interval = setInterval(healthCheck, 30000);
        
        return () => clearInterval(interval);
    }, []);
    
    const handleBackup = async (path) => {
        setBackupStatus('running');
        try {
            const grim = new GrimReaper();
            await grim.backup(path);
            setBackupStatus('completed');
        } catch (error) {
            setBackupStatus('failed');
            console.error('Backup failed:', error);
        }
    };
    
    return (
        <div className="grim-dashboard">
            <h1>🗡️ Grim Reaper Dashboard</h1>
            
            <div className="health-status">
                <h2>System Health</h2>
                {health && (
                    <div className={`status ${health.status}`}>
                        Status: {health.status}
                        <br />
                        Uptime: {health.uptime}
                        <br />
                        Memory: {health.memory}%
                    </div>
                )}
            </div>
            
            <div className="backup-controls">
                <h2>Backup Operations</h2>
                <button 
                    onClick={() => handleBackup('/important/data')}
                    disabled={backupStatus === 'running'}
                >
                    {backupStatus === 'running' ? 'Backing up...' : 'Start Backup'}
                </button>
                <div className="status">{backupStatus}</div>
            </div>
        </div>
    );
}

export default GrimDashboard;

Vue.js Integration

<template>
  <div class="grim-monitor">
    <h1>🗡️ Grim Reaper Monitor</h1>
    
    <div class="metrics">
      <div v-for="metric in metrics" :key="metric.name" class="metric-card">
        <h3>{{ metric.name }}</h3>
        <div class="value">{{ metric.value }}</div>
        <div class="trend" :class="metric.trend">{{ metric.change }}</div>
      </div>
    </div>
    
    <div class="controls">
      <button @click="startMonitoring" :disabled="monitoring">
        {{ monitoring ? 'Monitoring...' : 'Start Monitoring' }}
      </button>
      <button @click="stopMonitoring" :disabled="!monitoring">
        Stop Monitoring
      </button>
    </div>
  </div>
</template>

<script>
import { GrimReaper } from 'grim-reaper';

export default {
  name: 'GrimMonitor',
  data() {
    return {
      grim: new GrimReaper(),
      monitoring: false,
      metrics: [],
      interval: null
    }
  },
  methods: {
    async startMonitoring() {
      this.monitoring = true;
      
      // Start monitoring with Grim
      await this.grim.monitor('/var/log');
      
      // Update metrics every 5 seconds
      this.interval = setInterval(async () => {
        try {
          const stats = await this.grim.getStats();
          this.metrics = [
            { name: 'CPU Usage', value: `${stats.cpu}%`, change: stats.cpuChange, trend: stats.cpuTrend },
            { name: 'Memory', value: `${stats.memory}%`, change: stats.memoryChange, trend: stats.memoryTrend },
            { name: 'Disk I/O', value: `${stats.diskIO}/s`, change: stats.diskIOChange, trend: stats.diskIOTrend },
            { name: 'Network', value: `${stats.network}/s`, change: stats.networkChange, trend: stats.networkTrend }
          ];
        } catch (error) {
          console.error('Failed to get metrics:', error);
        }
      }, 5000);
    },
    
    async stopMonitoring() {
      this.monitoring = false;
      await this.grim.stopMonitoring();
      
      if (this.interval) {
        clearInterval(this.interval);
        this.interval = null;
      }
    }
  },
  
  beforeDestroy() {
    this.stopMonitoring();
  }
}
</script>

Node.js CLI Application

#!/usr/bin/env node

const { Command } = require('commander');
const GrimReaper = require('grim-reaper');
const chalk = require('chalk');
const ora = require('ora');

const program = new Command();
const grim = new GrimReaper();

program
  .name('grim-cli')
  .description('🗡️ Grim Reaper CLI - Death-defying data protection')
  .version('1.0.33');

program
  .command('backup <path>')
  .description('Create a backup of the specified path')
  .option('-c, --compress <algorithm>', 'compression algorithm', 'zstd')
  .option('-e, --encrypt', 'encrypt the backup')
  .option('-i, --incremental', 'incremental backup')
  .action(async (path, options) => {
    const spinner = ora('🗡️ Creating backup...').start();
    
    try {
      const result = await grim.backup(path, {
        compression: options.compress,
        encrypt: options.encrypt,
        incremental: options.incremental
      });
      
      spinner.succeed(chalk.green('✅ Backup completed successfully!'));
      console.log(chalk.blue(`📦 Backup ID: ${result.id}`));
      console.log(chalk.blue(`💾 Size: ${result.size} (${result.compressionRatio}x compression)`));
      console.log(chalk.blue(`⏱️  Duration: ${result.duration}s`));
    } catch (error) {
      spinner.fail(chalk.red('❌ Backup failed'));
      console.error(chalk.red(error.message));
      process.exit(1);
    }
  });

program
  .command('monitor <path>')
  .description('Start monitoring the specified path')
  .option('-i, --interval <seconds>', 'monitoring interval', '5')
  .option('-e, --events <types>', 'event types to monitor', 'all')
  .action(async (path, options) => {
    console.log(chalk.yellow('🔍 Starting monitoring...'));
    
    try {
      await grim.monitor(path, {
        interval: parseInt(options.interval),
        events: options.events
      });
      
      console.log(chalk.green(`✅ Monitoring started for: ${path}`));
      console.log(chalk.blue('Press Ctrl+C to stop monitoring'));
      
      // Keep the process running
      process.on('SIGINT', async () => {
        console.log(chalk.yellow('\n🛑 Stopping monitoring...'));
        await grim.stopMonitoring();
        console.log(chalk.green('✅ Monitoring stopped'));
        process.exit(0);
      });
      
    } catch (error) {
      console.error(chalk.red('❌ Monitoring failed:', error.message));
      process.exit(1);
    }
  });

program
  .command('health')
  .description('Check system health')
  .action(async () => {
    const spinner = ora('🩺 Checking system health...').start();
    
    try {
      const health = await grim.healthCheck();
      spinner.stop();
      
      console.log(chalk.bold('🗡️ Grim Reaper Health Report'));
      console.log('================================');
      
      const statusColor = health.status === 'healthy' ? 'green' : 
                         health.status === 'warning' ? 'yellow' : 'red';
      
      console.log(`Status: ${chalk[statusColor](health.status.toUpperCase())}`);
      console.log(`Uptime: ${chalk.blue(health.uptime)}`);
      console.log(`Memory: ${chalk.blue(health.memory)}%`);
      console.log(`Disk: ${chalk.blue(health.disk)}%`);
      console.log(`CPU: ${chalk.blue(health.cpu)}%`);
      
      if (health.warnings && health.warnings.length > 0) {
        console.log('\n⚠️ Warnings:');
        health.warnings.forEach(warning => {
          console.log(chalk.yellow(`  • ${warning}`));
        });
      }
      
      if (health.errors && health.errors.length > 0) {
        console.log('\n❌ Errors:');
        health.errors.forEach(error => {
          console.log(chalk.red(`  • ${error}`));
        });
      }
      
    } catch (error) {
      spinner.fail(chalk.red('❌ Health check failed'));
      console.error(chalk.red(error.message));
      process.exit(1);
    }
  });

program.parse();

Testing with Jest

const GrimReaper = require('grim-reaper');
const fs = require('fs').promises;
const path = require('path');
const os = require('os');

describe('GrimReaper', () => {
  let grim;
  let tempDir;
  
  beforeEach(async () => {
    grim = new GrimReaper();
    tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'grim-test-'));
  });
  
  afterEach(async () => {
    await fs.rmdir(tempDir, { recursive: true });
  });
  
  describe('backup functionality', () => {
    test('should create backup successfully', async () => {
      // Create test file
      const testFile = path.join(tempDir, 'test.txt');
      await fs.writeFile(testFile, 'Hello, Grim Reaper!');
      
      // Create backup
      const result = await grim.backup(tempDir);
      
      expect(result).toBeDefined();
      expect(result.id).toBeTruthy();
      expect(result.size).toBeGreaterThan(0);
      expect(result.compressionRatio).toBeGreaterThan(1);
    });
    
    test('should handle backup errors gracefully', async () => {
      const nonExistentPath = '/this/path/does/not/exist';
      
      await expect(grim.backup(nonExistentPath)).rejects.toThrow();
    });
  });
  
  describe('health check', () => {
    test('should return health status', async () => {
      const health = await grim.healthCheck();
      
      expect(health).toBeDefined();
      expect(health.status).toMatch(/healthy|warning|critical/);
      expect(typeof health.uptime).toBe('string');
      expect(typeof health.memory).toBe('number');
      expect(typeof health.cpu).toBe('number');
      expect(typeof health.disk).toBe('number');
    });
  });
  
  describe('monitoring', () => {
    test('should start monitoring successfully', async () => {
      const result = await grim.monitor(tempDir, { interval: 1 });
      
      expect(result).toBeDefined();
      expect(result.status).toBe('started');
      
      // Stop monitoring
      await grim.stopMonitoring();
    });
  });
  
  describe('compression', () => {
    test('should compress file with different algorithms', async () => {
      const testFile = path.join(tempDir, 'large-test.txt');
      const content = 'This is a test file for compression testing. '.repeat(1000);
      await fs.writeFile(testFile, content);
      
      const algorithms = ['zstd', 'gzip', 'lz4'];
      
      for (const algorithm of algorithms) {
        const result = await grim.compress(testFile, { algorithm });
        
        expect(result).toBeDefined();
        expect(result.algorithm).toBe(algorithm);
        expect(result.compressionRatio).toBeGreaterThan(1);
        expect(result.compressedSize).toBeLessThan(result.originalSize);
      }
    });
  });
});

🔗 Links & Resources

📄 License

By using this software you agree to the official license available at https://grim.so/license