Command-line tool for analyzing and managing dependencies with extensive configuration options and project integration features.
The autod command analyzes your project and displays/manages dependencies.
autod [options]Basic Usage Examples:
# Analyze current directory
autod
# Analyze specific path
autod -p /path/to/project
# Write dependencies to package.json
autod -w
# Check for missing dependencies
autod --check# Project Analysis
-p, --path <path> Root path to parse (default: '.')
-t, --test <paths> Test/benchmark/example directory paths
-e, --exclude <paths> Exclude directory paths (comma-separated)
# Registry and Versions
-r, --registry <url> Remote registry URL
-f, --prefix <prefix> Version prefix for dependencies (~ or ^)
-F, --devprefix <prefix> Version prefix for devDependencies (~ or ^)
# Output and Actions
-w, --write Write dependencies into package.json
-i, --ignore Ignore errors, display/write dependencies
-m, --map Display dependency-to-file mapping
--check Check for missing dependencies# Additional Dependencies
-d, --dep <modules> Modules to add as dependencies
-D, --devdep <modules> Modules to add as devDependencies
-k, --keep <modules> Modules to keep unchanged in package.json
-s, --semver <deps@ver> Auto-update modules within specified semver
# Advanced Options
-n, --notransform Disable ES6 transformation
-P, --plugin <name> Plugin module nameAdvanced Usage Examples:
# Exclude build directories and add custom dependencies
autod -e "build,dist,tmp" -d "lodash,moment" -D "mocha,chai"
# Use specific registry with version prefixes
autod -r https://registry.npmjs.org -f ^ -F ~
# Keep certain modules unchanged and update others
autod -k "react*,@types/*" -s "lodash@^4.0.0" -w
# Display dependency mapping and ignore errors
autod -m -i
# Check for missing dependencies without updating
autod --checkAutod supports persistent configuration through .autod.conf.js or .autod.conf.json files in the project root.
// .autod.conf.js
module.exports = {
root: '.',
registry: 'https://registry.npmjs.org',
exclude: ['build', 'dist', 'coverage'],
test: ['test', 'spec', 'tests'],
dep: ['lodash'],
devdep: ['mocha', 'chai'],
semver: {
'lodash': '^4.0.0'
},
prefix: '^',
devprefix: '~'
};{
"root": ".",
"registry": "https://registry.npmjs.org",
"exclude": ["build", "dist", "coverage"],
"test": ["test", "spec", "tests"],
"dep": ["lodash"],
"devdep": ["mocha", "chai"],
"semver": {
"lodash": "^4.0.0"
},
"prefix": "^",
"devprefix": "~"
}When running autod, you'll see:
[DEPENDENCIES]
Dependencies updates
┌──────────────┬─────────────┬────────────────┐
│ Package Name │ Old Version │ Latest Version │
├──────────────┼─────────────┼────────────────┤
│ lodash │ - │ ^4.17.21 │
│ express │ ^4.17.1 │ ^4.18.2 │
└──────────────┴─────────────┴────────────────┘
DevDependencies updates
┌──────────────┬─────────────┬────────────────┐
│ Package Name │ Old Version │ Latest Version │
├──────────────┼─────────────┼────────────────┤
│ mocha │ - │ ^10.2.0 │
└──────────────┴─────────────┴────────────────┘With -m option, you'll also see which files require each dependency:
[DEPENDENCY MAP]
express
app.js
routes/index.js
lodash
utils/helpers.js
lib/data-processor.jsWith --check, missing dependencies are reported:
[ERROR] Missing dependencies: ["lodash", "express"]
[ERROR] Missing devDependencies: ["mocha"]# Check for missing dependencies in CI
autod --check || exit 1
# Update dependencies in development
autod -w -i# Daily dependency update
autod -w -f ^ --registry https://registry.npmjs.org
# Pre-commit hook
autod --check# Use custom parser plugin
autod -P my-custom-parser --notransformAutod determines the registry in this order:
-r/--registry optionnpm_config_registry environment variablepublishConfig.registry in package.jsonhttps://registry.npmjs.org# Common exit codes:
# 0 - Success
# 1 - Errors found (unless -i/--ignore used)
# 1 - Missing dependencies (in --check mode)Error Examples:
# Continue despite parse errors
autod -i -w
# Strict checking (fail on any issues)
autod --check# Available prefixes:
# ^ - Compatible with (default for -f)
# ~ - Reasonably close to
# (none) - Exact versionPrefix Examples:
# Use ^ for dependencies, ~ for devDependencies
autod -f ^ -F ~ -w
# Use exact versions
autod -w