dep_audit 0.1.9 copy "dep_audit: ^0.1.9" to clipboard
dep_audit: ^0.1.9 copied to clipboard

A Dart and Flutter dependency audit tool that identifies outdated packages and security vulnerabilities.

dep_audit #

pub version pub points popularity likes

CI codecov License: MIT

Dart Flutter Platform


A powerful, lightweight dependency and package health auditor for Dart & Flutter projects. dep_audit scans your pubspec.yaml and source code to create a clear, actionable report on your project's dependencies.

๐ŸŽฏ Perfect pub.dev Score: Rated 160/160 points with full WASM compatibility

๐Ÿ“‹ Table of Contents #

โœจ Features #

  • ๐Ÿ” Outdated Dependencies: Compares your locked versions against the latest on pub.dev
  • ๐Ÿงน Unused Dependencies: Scans your code for import statements to find dependencies that are declared but never used
  • โš ๏ธ Abandoned Packages: Checks package metadata for discontinued flags or long periods of inactivity (stale)
  • ๐Ÿ”ง Safe Auto-Fixing: Automatically run safe fixes with a --fix flag to remove unused packages and upgrade outdated ones
  • ๐Ÿ“Š Multiple Report Formats: Output reports in human-readable text or machine-readable JSON for CI/CD pipelines
  • ๐ŸŒ Cross-Platform: Works on Linux, macOS, Windows, and Web (WASM compatible)
  • โšก Fast & Lightweight: Minimal dependencies, maximum performance
  • ๐ŸŽฏ CI/CD Ready: Perfect for automated workflows and quality gates

๐Ÿ“ฆ Installation #

Install once globally to use across all your projects:

dart pub global activate dep_audit

Project-Specific Installation #

Add as a dev dependency for team consistency:

dart pub add --dev dep_audit

๐Ÿš€ Usage #

Quick Start #

# Navigate to your Dart/Flutter project
cd your_project

# Run basic audit
dep_audit

# Run with auto-fix
dep_audit --fix

# Include dev dependencies
dep_audit --include-dev

# Generate JSON report for CI
dep_audit --format json

Command Line Options #

Flag Abbreviation Description
--fix ๐Ÿ”ง Automatically apply safe fixes
--path <directory> -p ๐Ÿ“‚ Specify the project path to audit (default: .)
--include-dev ๐Ÿ› ๏ธ Include dev_dependencies in the audit
--format <format> -f ๐Ÿ“„ Output format: text or json (default: text)
--help -h โ“ Show help information
--version โ„น๏ธ Show version information

๐Ÿ’ก Examples #

Basic Audit #

$ dep_audit
โœ… Analyzing dependencies for your_project...

๐Ÿ“ฆ DEPENDENCY AUDIT REPORT
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ Project: your_project               โ”‚
โ”‚ Dependencies: 12 total, 8 analyzed โ”‚ 
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

๐Ÿ” OUTDATED (3 found):
โ”œโ”€โ”€ http: 0.13.5 โ†’ 1.2.1 (available)
โ”œโ”€โ”€ path: 1.8.3 โ†’ 1.9.0 (available)  
โ””โ”€โ”€ yaml: 3.1.1 โ†’ 3.1.2 (available)

๐Ÿงน UNUSED (1 found):
โ””โ”€โ”€ crypto: declared but never imported

โš ๏ธ ABANDONED (0 found):
No abandoned packages detected.

๐Ÿ’ก Run with --fix to automatically update outdated and remove unused dependencies.

Auto-Fix Mode #

$ dep_audit --fix
โœ… Analyzing dependencies...
๐Ÿ”ง Applying fixes...
  โ”œโ”€โ”€ Upgraded http: 0.13.5 โ†’ 1.2.1
  โ”œโ”€โ”€ Upgraded path: 1.8.3 โ†’ 1.9.0
  โ”œโ”€โ”€ Upgraded yaml: 3.1.1 โ†’ 3.1.2
  โ””โ”€โ”€ Removed unused: crypto
โœ… All fixes applied successfully!

CI/CD Integration #

$ dep_audit --format json | jq '.outdated | length'
3

# GitHub Actions workflow
- name: Audit Dependencies
  run: |
    dart pub global activate dep_audit
    dep_audit --format json > audit_report.json
    # Fail if critical issues found
    if [[ $(jq '.outdated | length' audit_report.json) -gt 5 ]]; then
      echo "Too many outdated dependencies!"
      exit 1
    fi

โš™๏ธ Configuration #

Create a dep_audit.yaml file in your project root for custom configuration:

# dep_audit.yaml
ignore:
  outdated:
    - package_name  # Ignore specific outdated packages
  unused:
    - test_package  # Keep packages that might be used in tests
  abandoned:
    - legacy_pkg    # Accept known legacy packages

thresholds:
  outdated_days: 90     # Consider package outdated after 90 days
  abandoned_days: 365   # Consider package abandoned after 1 year
  
include_dev: false      # Include dev_dependencies by default
auto_fix: false         # Enable auto-fix by default
format: "text"          # Default output format

๐Ÿค Contributing #

We welcome contributions! Please see our Contributing Guide for details.

Quick Contributing Steps #

  1. ๐Ÿด Fork the repository
  2. ๐ŸŒฑ Create a feature branch (git checkout -b feature/amazing-feature)
  3. ๐Ÿ’ป Make your changes
  4. โœ… Run tests (dart test)
  5. ๐Ÿ“ Commit your changes (git commit -m 'Add amazing feature')
  6. ๐Ÿ“ค Push to the branch (git push origin feature/amazing-feature)
  7. ๐Ÿ”„ Open a Pull Request

๐Ÿ“„ License #

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ“ Changelog #

See CHANGELOG.md for a detailed history of changes.

๐Ÿ™ Acknowledgments #

  • Built with โค๏ธ using Dart
  • Inspired by npm-audit and other dependency management tools
  • Thanks to all contributors

โฌ† Back to Top

Made with โค๏ธ by @B33b3k | Report Bug | Request Feature

1
likes
160
points
288
downloads

Publisher

verified publisherbibekadhikari18.com.np

Weekly Downloads

A Dart and Flutter dependency audit tool that identifies outdated packages and security vulnerabilities.

Homepage
Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

MIT (license)

Dependencies

args, glob, http, path, pub_semver, yaml

More

Packages that depend on dep_audit