dep-changelog
v1.1.3
Published
Effortlessly track changes in package.json dependencies and devDependencies over time using Git commit history.
Maintainers
Readme
dep-changelog
A CLI tool to track changes in package.json dependencies and devDependencies over a specified date range using Git commit history.
Features
- Analyze changes to
dependenciesanddevDependenciesinpackage.jsonfiles. - Specify a time range to focus on specific commits.
- Support for multiple output formats:
- Human-readable (default)
- JSON
- CSV
- Group changes by package name and file path for better clarity.
Installation
Install globally via npm:
npm install -g dep-changelogOr use it directly with npx:
npx dep-changelogUsage
Run the tool in a Git repository to analyze dependency changes:
dep-changelog --since <start-date> --until <end-date> [options]Options
| Option | Alias | Description | Default |
|----------------|-------|------------------------------------------------------------------|----------------------------|
| --since | -s | Start date for analysis (e.g., 2024-01-01). | Required |
| --until | -u | End date for analysis (e.g., 2024-12-31). | Required |
| --output | -o | Output file path for results. | dependency_changes.csv |
| --format | -f | Output format (human, json, csv). | human |
| --help | | Show help information. | |
Examples
Default Human-Readable Format:
dep-changelog --since 2024-01-01 --until 2024-12-31Output in JSON Format:
dep-changelog --since 2024-01-01 --until 2024-12-31 --format=json --output=changes.jsonOutput in CSV Format:
dep-changelog --since 2024-01-01 --until 2024-12-31 --format=csv --output=changes.csv
Output Formats
Human-Readable Format (Default)
## docs/accessibility/package.json:
### dependencies
- some-library
- 2024/01/05: Added version 1.0 (#commit-hash)
- 2024/02/04: Modified version 1.0 -> 1.2
### devDependencies
- another-library
- 2024/01/05: Added version 1.0 (#commit-hash)
- 2024/02/04: Modified version 1.0 -> 1.2JSON Format
[
{
"packageName": "some-library",
"filePath": "docs/accessibility/package.json",
"dependencyType": "dependency",
"changeType": "added",
"commitDate": "2024-01-05",
"newVersion": "1.0",
"commitHash": "commit-hash"
},
...
]CSV Format
Library Name,Package Path,Dependency Type,Change Type,Commit Date,Previous Version,New Version
some-library,docs/accessibility/package.json,dependency,added,2024-01-05,,1.0
some-library,docs/accessibility/package.json,dependency,modified,2024-02-04,1.0,1.2Testing
To test the project, ensure Jest is installed and run:
npm testContribution
Contributions are welcome! Please:
- Fork the repository.
- Create a feature branch.
- Submit a pull request with a clear description of changes.
License
This project is licensed under the MIT License.
