From 4320fa0796d7017c925276bad12b4ae7f486acf9 Mon Sep 17 00:00:00 2001 From: Tiago Almeida Date: Wed, 13 Nov 2019 15:26:32 -0500 Subject: [PATCH 1/2] Added option for specific packages --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 1cb3a55..8d17c9d 100644 --- a/index.js +++ b/index.js @@ -28,7 +28,8 @@ const execP = outdatedCommand => { }; export default async function npmOutdated(options = {}) { - let outdatedCommand = "npm outdated --json"; + const filterPackages = (options.packages || []).join(' '); + let outdatedCommand = `npm outdated ${filterPackages} --json`; try { const outdatedPackages = await execP(outdatedCommand); From ed468f0d3eae0b882dc3ce3ff97dd0863557441a Mon Sep 17 00:00:00 2001 From: Tiago Almeida Date: Wed, 13 Nov 2019 15:29:38 -0500 Subject: [PATCH 2/2] Updated Readme --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a883baf..5092f4d 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,9 @@ import { schedule } from "danger"; import npmOutdated from "danger-plugin-npm-outdated"; // Note: You need to use schedule() -schedule(npmOutdated()); +schedule(npmOutdated({ + packages: ['@babel/cli'], // (OPTIONAL) Specify which packages you want to target +})); ``` ## Sample message