| name | license-checker |
| description | Audits node_modules for package licenses. Uses bash to resolve SPDX IDs without reading file contents into context. LLM inference is a last resort for a small residual set. |
| author | DigitalSpeed |
License Checker
Scan all packages in node_modules and produce a license compliance report. Never read raw file contents into context — use bash to pattern-match first; only buffer the irreducible unknown set.
1. Execution Workflow
Step 1 — Bulk resolve (single bash call, handles scoped packages, zero file reads in context):
SPDX='MIT|ISC|BSD-[0-9]+-Clause|Apache-2\.0|GPL-[23]\.0(-only|-or-later)?|LGPL-[23]\.0|AGPL-3\.0|MPL-2\.0|Unlicense|CC0-1\.0|CDDL-1\.[01]|EPL-[12]\.0|EUPL-1\.[12]'
find node_modules -mindepth 2 -maxdepth 3 -name 'package.json' \
! -path '*/.bin/*' ! -path '*/node_modules/*/node_modules/*' | while read pjson; do
dir=$(dirname "$pjson")
row=$(jq -r '[.name, .version, (.license // (.licenses | if type=="array" then map(.type//"") | join(" OR ") else (.//"") end) // ""), (.repository.url // .repository // "")] | @tsv' "$pjson" 2>/dev/null)
lic=$(printf | -f3)
[ -z ];
lfile=$(find -maxdepth 1 \( -iname -o -iname -o -iname \) 2>/dev/null | -1)
match=$(grep -iom1 -E 2>/dev/null | -1)
[ -n ];