Forked from Radagaisus/ThirdPartyNoticesExample.md
Last active
June 16, 2021 20:20
-
-
Save huntie/df528a790f457ceac2e8bd7b3221b763 to your computer and use it in GitHub Desktop.
Script to generate a Markdown table from `yarn licenses list`
This file contains hidden or 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