@ratcopycat/license-lens
v1.0.1
Published
Scan node_modules and generate a markdown report of all package licenses
Maintainers
Readme
@ratcopycat/license-lens
A tiny CLI tool to scan node_modules and generate a markdown report of all package licenses.
Installation
npm install -g @ratcopycat/license-lensOr use directly with npx (no installation required):
npx @ratcopycat/license-lensUsage
Run in your project directory:
npx @ratcopycat/license-lensThis will create a LICENSES.md file with a table of all dependencies and their licenses.
Options
-o, --output <file> Output file path (default: LICENSES.md)
-d, --dir <path> Target directory to scan (default: current directory)
-h, --help Show help message
-v, --version Show version numberExamples
# Generate report in current directory
npx license-lens
# Custom output file
npx license-lens -o licenses-report.md
# Scan a specific directory
npx license-lens -d ./my-projectOutput
The generated markdown file includes:
- Total package count
- MIT vs Non-MIT license breakdown
- Sorted table with package name, version, and license type
- Visual indicators (✅ for MIT, ❌ for non-MIT)
Programmatic Usage
const { scanLicenses, scanNodeModules, generateMarkdown } = require('license-lens');
// Full scan with file output
scanLicenses('./my-project', 'LICENSES.md');
// Or use individual functions
const packages = scanNodeModules('./my-project/node_modules');
const markdown = generateMarkdown(packages);License
MIT
