-
-
Save andrewmcodes/5c932b04d0ae45ca9cff6498cec2a568 to your computer and use it in GitHub Desktop.
Script to generate a Markdown table from `yarn licenses list`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Output a dependencies.md file with a table of installed Yarn dependencies | |
# Requires csvkit, jq | |
# https://csvkit.readthedocs.io/en/0.9.1/install.html | |
# https://stedolan.github.io/jq/download/ | |
yarn licenses list --json \ | |
| jq --slurp 'map(select(.type == "table"))' \ | |
| jq -c [.[0].data.head],.[0].data.body \ | |
| sed -E 's/\],\[/\n/g' \ | |
| csvlook \ | |
| sed -E 's/(\[|\]|")+/ /g' > dependencies.md |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment