|
|
@@ -1,4 +1,5 @@
|
|
|
import yargs from "yargs/yargs";
|
|
|
+import path from "path";
|
|
|
|
|
|
import { hideBin } from "yargs/helpers";
|
|
|
|
|
|
@@ -11,12 +12,6 @@ const args = yargs(hideBin(process.argv))
|
|
|
describe: "The full or relative path to the package.json file",
|
|
|
require: true
|
|
|
})
|
|
|
- .option("packageLock", {
|
|
|
- alias: "package-lock",
|
|
|
- type: "string",
|
|
|
- describe: "The full or relative path to the package-lock.json file",
|
|
|
- require: true
|
|
|
- })
|
|
|
.option("format", {
|
|
|
choices: formats,
|
|
|
demandOption: true,
|
|
|
@@ -97,7 +92,7 @@ const displayDepTreeAsCsv = (tree: PackageLockTree, depType: "dependency" | "dev
|
|
|
|
|
|
Promise.all<Package, PackageLock>([
|
|
|
import(args.package),
|
|
|
- import(args.packageLock)
|
|
|
+ import(`${path.dirname(args.package)}/package-lock.json`)
|
|
|
])
|
|
|
.then(([json, jsonLock]) => {
|
|
|
const dependencyTree = Object.keys(json.dependencies)
|