docs/package-deprecation.md
Experimental {: .label }
OSV-Scanner can identify and report unsupported or removed packages in dependencies.
This feature leverages the deps.dev API.
The deprecated field is a boolean value indicating if a package is flagged as unsupported. This includes states such as:
To enable package deprecation reporting, use the --experimental-flag-deprecated-packages flag. The feature is not available in the spdx format.
osv-scanner scan source --experimental-flag-deprecated-packages -r /path/to/project
For more details on source scanning, see Project Source Scanning.
# Scan a local or remote image by name
osv-scanner scan image --experimental-flag-deprecated-packages my-image:tag
# Scan an exported image archive
osv-scanner scan image --experimental-flag-deprecated-packages --archive ./path/to/my-image.tar
For more details on image scanning, see Container Image Scanning.
When enabled, the output reports deprecated packages as follows:
deprecated field in the package object.deprecated property in component.If no deprecated packages are detected, the corresponding section or field is omitted.
<details markdown="block"> <summary> Example JSON Output </summary>{
"results": [
{
"source": {
"path": "/path/to/lockfile",
"type": "lockfile"
},
"packages": [
{
"package": {
"name": "deprecated-package",
"version": "1.0.0",
"ecosystem": "npm",
"deprecated": true
}
},
{
"package": {
"name": "not-deprecated-package",
"version": "2.0.0",
"ecosystem": "npm"
}
}
]
}
]
}