nodry
v1.0.6
Published
A CLI tool and Node.js library that warns about repetitive code to help you stay DRY.
Downloads
21
Maintainers
Readme
# nodry


**nodry** is a simple and effective tool—available both as a CLI and as a module—that detects repetitive code blocks in your JavaScript files. It helps you follow the **DRY (Don't Repeat Yourself)** principle, making your code cleaner and easier to maintain.
---
## Installation
Install globally to use the CLI:
```bash
npm install -g nodryOr install locally as a dependency to use programmatically:
npm install nodryUsage
CLI
Analyze a JavaScript file directly from your terminal:
nodry myfile.jsYou will get a report highlighting repeated code blocks and suggestions.
As a module in your Node.js project
Import and use the analyzeFile function programmatically:
const { analyzeFile } = require('nodry');
analyzeFile('myfile.js')
.then(report => {
console.log(report);
})
.catch(err => {
console.error('Analysis failed:', err);
});Features
- Automatically detects repeated code blocks in JavaScript files
- Works as both a command-line tool and a programmatic API
- Provides clear reports to help you refactor and keep your code DRY
- Easy to install and integrate into existing workflows
License
ISC
