Intelligent dependency optimization and code refactoring for Node.js applications
NodeOpti is a comprehensive command-line tool that analyzes, optimizes, and refactors your Node.js projects. It automatically identifies unused dependencies, applies performance-focused code transformations, and provides detailed insights into your project's dependency graph.
- Automated dependency cleanup - Remove unused packages and optimize bundle size
- Intelligent code refactoring - Apply performance-focused codemods to your source code
- Dependency visualization - Interactive tree view with size and security annotations
- Development acceleration - Mock heavy dependencies for faster local development
- Security analysis - Identify and address known vulnerabilities
npm install -g nodeopti# Analyze your project
nodeopti analyze
# Visualize dependencies
nodeopti tree
# Preview optimizations
nodeopti optimize
# Apply all optimizations
nodeopti optimize --applyProvides a comprehensive project health summary including unused dependencies, security vulnerabilities, and optimization opportunities.
Renders an interactive dependency tree with package sizes and security risk indicators.
Identifies and applies code optimizations:
- Dry run (default): Preview changes without modifying files
- Apply mode (
--apply): Automatically implement all optimizations
High-performance package installer built on the pnpm engine.
# Install all dependencies
nodeopti install
# Add new packages
nodeopti install lodash expressNodeOpti applies intelligent codemods to improve performance and reduce bundle size:
// Before
const _ = require('lodash');
if (_.isNil(value)) { ... }
// After
const isNil = require('lodash/isNil');
if (value == null) { ... }// Before
moment().format('YYYY-MM-DD')
// After
new Date().toISOString().split('T')[0]Speed up local development by mocking heavy dependencies:
Configuration (package.json):
{
"nodeOpti": {
"virtualize": {
"aws-sdk": { "mock": "./mocks/aws.mock.js" }
}
}
}When you run nodeopti install, heavy packages are replaced with lightweight mocks, dramatically improving startup times.
- Built on the battle-tested pnpm engine
- Disk-space efficient installations
- Vulnerability scanning and reporting
- Bundle size optimization
- Node.js 14.0.0 or higher
- npm 6.0.0 or higher
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ by the NodeOpti team
