From 8103febbb6342da64eced594aff4072f04cf41b6 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 31 Dec 2020 15:57:49 +0100 Subject: [PATCH] Added prettify option --- exporter.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/exporter.js b/exporter.js index 55e05f6..83b584d 100644 --- a/exporter.js +++ b/exporter.js @@ -46,4 +46,9 @@ function getDependencyLicenseInfo(all_dependencies, recursive){ const packageInfo = parsePackageInfo(`./package.json`); const all = getDependencyLicenseInfo(mergeDependencies(packageInfo), args.includes("--recursive")); -fs.writeFileSync('./licenses.json', JSON.stringify(all)); \ No newline at end of file +if(args.includes("--pretty")){ + fs.writeFileSync('./licenses.json', JSON.stringify(all, null, 4)); +} +else{ + fs.writeFileSync('./licenses.json', JSON.stringify(all)); +} \ No newline at end of file