Last active
February 8, 2023 16:14
-
-
Save scicco/ee0cbb570dbc909dcd5c6bcdeac8ceef to your computer and use it in GitHub Desktop.
yarn_licences_csv.rb
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
# "@ampproject/remapping", # name | |
# "2.2.0", # version | |
# "Apache-2.0", # license | |
# "git+https://github.com/ampproject/remapping.git", # repository | |
# "Unknown", # homepage | |
# "Justin Ridgewell" # author | |
require 'json' | |
require 'csv' | |
# Read data from the JSON file | |
file = File.read('yarn_licenses.json') | |
data = JSON.parse(file) | |
# Write data to the CSV file | |
CSV.open("yarn_licenses.csv", "w") do |csv| | |
csv << %w(name version summary license author homepage ) | |
data.each do |row| | |
csv << [row[0], row[1], '', row[2], row[5], row[4]] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment