UNPKG

@solidstate/hardhat-license-identifier

Version:
19 lines (18 loc) 673 B
import { createTable } from '@solidstate/hardhat-solidstate-utils/table'; import chalk from 'chalk'; export const printSourceLicenses = (packageJsonLicense, sourceLicenses) => { const table = createTable(); table.push([ { content: chalk.gray('package.json') }, { content: chalk.gray(packageJsonLicense) }, ]); table.push([ { content: chalk.bold('Source Path') }, { content: chalk.bold('License') }, ]); for (const sourceLicense of sourceLicenses) { const { sourcePath, license } = sourceLicense; table.push([{ content: sourcePath }, { content: license }]); } console.log(table.toString()); };