{"id":18282,"library":"droidperf","title":"droidperf","description":"Android Gradle performance auditor and auto-fixer that scans projects for common build misconfigurations (e.g., disabled configuration cache, parallel execution, or low JVM heap) and applies safe, revertible edits. Version 1.0.4 is the latest stable release; the project follows a monthly release cadence with conservative fixes, transparent diffs via --dry-run, and timestamped backups. Unlike generic Gradle optimization guides, droidperf provides automated audit-to-fix workflows, machine-readable JSON output for CI, and rule-specific enable/disable configuration.","status":"active","version":"1.0.4","language":"javascript","source_language":"en","source_url":"https://github.com/rudradave1/droidperf","tags":["javascript","android","gradle","performance","build","audit","cli"],"install":[{"cmd":"npm install droidperf","lang":"bash","label":"npm"},{"cmd":"yarn add droidperf","lang":"bash","label":"yarn"},{"cmd":"pnpm add droidperf","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only since v1.0.0; CommonJS require() not supported.","wrong":"const droidperf = require('droidperf')","symbol":"default export","correct":"import droidperf from 'droidperf'"},{"note":"Named export for programmatic audit; only available in ESM.","wrong":"const { runAudit } = require('droidperf')","symbol":"runAudit","correct":"import { runAudit } from 'droidperf'"},{"note":"Named export for programmatic fix; requires options object with dryRun and rules.","symbol":"runFix","correct":"import { runFix } from 'droidperf'"}],"quickstart":{"code":"import { runAudit, runFix } from 'droidperf';\n\nasync function main() {\n  const projectPath = '/path/to/android/project';\n  \n  // Audit\n  const auditResult = await runAudit(projectPath);\n  console.log(auditResult.issues);\n  \n  // Fix (dry run first)\n  const dryFixResult = await runFix(projectPath, { dryRun: true });\n  console.log(dryFixResult.diffs);\n  \n  // Apply fixes\n  await runFix(projectPath);\n}\n\nmain().catch(console.error);","lang":"typescript","description":"Shows programmatic audit and fix workflow with dry-run support, using ESM imports and async/await."},"warnings":[{"fix":"Update imports to ESM style: `import droidperf from 'droidperf'` or `import { runAudit } from 'droidperf'`.","message":"v0.1.x API (CommonJS, default export as function) is deprecated; upgrade to v1.0.x ESM API.","severity":"deprecated","affected_versions":">=0.1.0 <1.0.0"},{"fix":"Use `import` syntax or enable ESM in your project (e.g., `\"type\": \"module\"` in package.json).","message":"Switched to ESM-only in v1.0.0; removed CommonJS support.","severity":"breaking","affected_versions":">=0.0.0 <1.0.0"},{"fix":"Upgrade Node.js to 18 or later.","message":"Requires Node.js >=18; older versions will fail with syntax errors.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use `--json` alone for machine-readable output; run separately from normal audit/fix.","message":"The `--json` flag outputs to stdout; do not mix with human-readable output in the same run.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Manual changes may be needed for settings in build.gradle; droidperf only handles gradle.properties settings.","message":"Fixes are applied to `gradle.properties` only; other build files (e.g., build.gradle) are not modified.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use `import droidperf from 'droidperf'` and ensure Node.js >=18.","cause":"Running droidperf with CommonJS require() or Node.js <18.","error":"SyntaxError: Unexpected token 'export'"},{"fix":"Verify the project path points to an Android project root (where gradle.properties resides).","cause":"The specified project path does not contain gradle.properties or is not an Android project.","error":"Error: ENOENT: no such file or directory, open '.../gradle.properties'"},{"fix":"Install via `npm install droidperf --save-dev` and ensure node_modules is present.","cause":"droidperf not installed or not in node_modules.","error":"Error: Cannot find module 'droidperf'"},{"fix":"Use `import droidperf from 'droidperf'` or switch to named imports like `import { runAudit } from 'droidperf'`.","cause":"Using default import incorrectly with CommonJS require() in v1.x.","error":"TypeError: droidperf is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}