{"action":"closed","number":169,"pull_request":{"url":"https://api.github.com/repos/davglass/license-checker/pulls/169","id":202455272,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAyNDU1Mjcy","html_url":"https://github.com/davglass/license-checker/pull/169","diff_url":"https://github.com/davglass/license-checker/pull/169.diff","patch_url":"https://github.com/davglass/license-checker/pull/169.patch","issue_url":"https://api.github.com/repos/davglass/license-checker/issues/169","number":169,"state":"closed","locked":false,"title":"feat: allow restricting output to specified packages","user":{"login":"codepunkt","id":603683,"node_id":"MDQ6VXNlcjYwMzY4Mw==","avatar_url":"https://avatars0.githubusercontent.com/u/603683?v=4","gravatar_id":"","url":"https://api.github.com/users/codepunkt","html_url":"https://github.com/codepunkt","followers_url":"https://api.github.com/users/codepunkt/followers","following_url":"https://api.github.com/users/codepunkt/following{/other_user}","gists_url":"https://api.github.com/users/codepunkt/gists{/gist_id}","starred_url":"https://api.github.com/users/codepunkt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codepunkt/subscriptions","organizations_url":"https://api.github.com/users/codepunkt/orgs","repos_url":"https://api.github.com/users/codepunkt/repos","events_url":"https://api.github.com/users/codepunkt/events{/privacy}","received_events_url":"https://api.github.com/users/codepunkt/received_events","type":"User","site_admin":false},"body":"Hello everyone and a special hello to @davglass!\r\n\r\nThanks for this amazing package - it helps me not implement a lot of things i'd otherwise have to implement! 👍 \r\n\r\nUntil now, restricting the generated output to specific packages (and versions) is not possible.\r\nIn an environment where a legal department has to check every open source license that is part of a delivered product, the only way to handle this with the current version of `license-checker` is to scan **all** dependencies (including devDependencies).\r\n\r\nUsing the `--production` switch is not feasible in this scenario, because especially in frontend applications that are built using tooling such as `webpack`, `parcel`, `rollup`, `browserify` or others, the tools unfortunately don't care if a dependency that is included in a build artifact was listed as a or derived from a devDependency or a dependency.\r\n\r\nBecause the bulk of our builds is done with `webpack`, i'm implementing a webpack plugin that generates a list of packages and versions that are actually part of a build output and would love to use depend on `license-checker` to do the heavy-lifting in regards to checking licenses. To do so, i need a way to restrict the `license-checker` output to specific packages and versions while ignoring the rest.\r\n\r\nAnother way to deal with this would be to expose a method that can check the license of a single package, but that would involve a lot of refactoring, dealing with `read-installed` and more. I've tried it and it did not look & feel well.\r\n\r\nTherefore, i've implemented an additional CLI switch called `--packages` that accepts a semicolon-separated list of package@version identifiers and restricts the output of `license-checker` to these packages. The code changes are minimal because all packages read by `read-installed` are checked and the filtered return value is then restricted to the given packages.\r\n\r\nI'm aware that this is not the most performant solution, but i'm perfectly fine with that because i did not have to introduce a lot of changes and `license-checker` is pretty fast regardless.","created_at":"2018-07-19T06:18:17Z","updated_at":"2018-07-30T13:49:08Z","closed_at":"2018-07-30T13:49:08Z","merged_at":"2018-07-30T13:49:08Z","merge_commit_sha":"58ccc0b06e813fdc936aff42094ba79327b0355a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/davglass/license-checker/pulls/169/commits","review_comments_url":"https://api.github.com/repos/davglass/license-checker/pulls/169/comments","review_comment_url":"https://api.github.com/repos/davglass/license-checker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/davglass/license-checker/issues/169/comments","statuses_url":"https://api.github.com/repos/davglass/license-checker/statuses/5e4b274e955485fb2aba37e65fec913b8042f38d","head":{"label":"codepunkt:restrict_packages","ref":"restrict_packages","sha":"5e4b274e955485fb2aba37e65fec913b8042f38d","user":{"login":"codepunkt","id":603683,"node_id":"MDQ6VXNlcjYwMzY4Mw==","avatar_url":"https://avatars0.githubusercontent.com/u/603683?v=4","gravatar_id":"","url":"https://api.github.com/users/codepunkt","html_url":"https://github.com/codepunkt","followers_url":"https://api.github.com/users/codepunkt/followers","following_url":"https://api.github.com/users/codepunkt/following{/other_user}","gists_url":"https://api.github.com/users/codepunkt/gists{/gist_id}","starred_url":"https://api.github.com/users/codepunkt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codepunkt/subscriptions","organizations_url":"https://api.github.com/users/codepunkt/orgs","repos_url":"https://api.github.com/users/codepunkt/repos","events_url":"https://api.github.com/users/codepunkt/events{/privacy}","received_events_url":"https://api.github.com/users/codepunkt/received_events","type":"User","site_admin":false},"repo":{"id":141393913,"node_id":"MDEwOlJlcG9zaXRvcnkxNDEzOTM5MTM=","name":"license-checker","full_name":"codepunkt/license-checker","owner":{"login":"codepunkt","id":603683,"node_id":"MDQ6VXNlcjYwMzY4Mw==","avatar_url":"https://avatars0.githubusercontent.com/u/603683?v=4","gravatar_id":"","url":"https://api.github.com/users/codepunkt","html_url":"https://github.com/codepunkt","followers_url":"https://api.github.com/users/codepunkt/followers","following_url":"https://api.github.com/users/codepunkt/following{/other_user}","gists_url":"https://api.github.com/users/codepunkt/gists{/gist_id}","starred_url":"https://api.github.com/users/codepunkt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codepunkt/subscriptions","organizations_url":"https://api.github.com/users/codepunkt/orgs","repos_url":"https://api.github.com/users/codepunkt/repos","events_url":"https://api.github.com/users/codepunkt/events{/privacy}","received_events_url":"https://api.github.com/users/codepunkt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/codepunkt/license-checker","description":"Check NPM package licenses","fork":true,"url":"https://api.github.com/repos/codepunkt/license-checker","forks_url":"https://api.github.com/repos/codepunkt/license-checker/forks","keys_url":"https://api.github.com/repos/codepunkt/license-checker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codepunkt/license-checker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codepunkt/license-checker/teams","hooks_url":"https://api.github.com/repos/codepunkt/license-checker/hooks","issue_events_url":"https://api.github.com/repos/codepunkt/license-checker/issues/events{/number}","events_url":"https://api.github.com/repos/codepunkt/license-checker/events","assignees_url":"https://api.github.com/repos/codepunkt/license-checker/assignees{/user}","branches_url":"https://api.github.com/repos/codepunkt/license-checker/branches{/branch}","tags_url":"https://api.github.com/repos/codepunkt/license-checker/tags","blobs_url":"https://api.github.com/repos/codepunkt/license-checker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codepunkt/license-checker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codepunkt/license-checker/git/refs{/sha}","trees_url":"https://api.github.com/repos/codepunkt/license-checker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codepunkt/license-checker/statuses/{sha}","languages_url":"https://api.github.com/repos/codepunkt/license-checker/languages","stargazers_url":"https://api.github.com/repos/codepunkt/license-checker/stargazers","contributors_url":"https://api.github.com/repos/codepunkt/license-checker/contributors","subscribers_url":"https://api.github.com/repos/codepunkt/license-checker/subscribers","subscription_url":"https://api.github.com/repos/codepunkt/license-checker/subscription","commits_url":"https://api.github.com/repos/codepunkt/license-checker/commits{/sha}","git_commits_url":"https://api.github.com/repos/codepunkt/license-checker/git/commits{/sha}","comments_url":"https://api.github.com/repos/codepunkt/license-checker/comments{/number}","issue_comment_url":"https://api.github.com/repos/codepunkt/license-checker/issues/comments{/number}","contents_url":"https://api.github.com/repos/codepunkt/license-checker/contents/{+path}","compare_url":"https://api.github.com/repos/codepunkt/license-checker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codepunkt/license-checker/merges","archive_url":"https://api.github.com/repos/codepunkt/license-checker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codepunkt/license-checker/downloads","issues_url":"https://api.github.com/repos/codepunkt/license-checker/issues{/number}","pulls_url":"https://api.github.com/repos/codepunkt/license-checker/pulls{/number}","milestones_url":"https://api.github.com/repos/codepunkt/license-checker/milestones{/number}","notifications_url":"https://api.github.com/repos/codepunkt/license-checker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codepunkt/license-checker/labels{/name}","releases_url":"https://api.github.com/repos/codepunkt/license-checker/releases{/id}","deployments_url":"https://api.github.com/repos/codepunkt/license-checker/deployments","created_at":"2018-07-18T06:54:53Z","updated_at":"2018-07-18T06:54:55Z","pushed_at":"2018-07-30T07:11:38Z","git_url":"git://github.com/codepunkt/license-checker.git","ssh_url":"git@github.com:codepunkt/license-checker.git","clone_url":"https://github.com/codepunkt/license-checker.git","svn_url":"https://github.com/codepunkt/license-checker","homepage":null,"size":340,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"davglass:master","ref":"master","sha":"5f63f8766a17e589b57db99bda4eb54d91b85b77","user":{"login":"davglass","id":32551,"node_id":"MDQ6VXNlcjMyNTUx","avatar_url":"https://avatars2.githubusercontent.com/u/32551?v=4","gravatar_id":"","url":"https://api.github.com/users/davglass","html_url":"https://github.com/davglass","followers_url":"https://api.github.com/users/davglass/followers","following_url":"https://api.github.com/users/davglass/following{/other_user}","gists_url":"https://api.github.com/users/davglass/gists{/gist_id}","starred_url":"https://api.github.com/users/davglass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davglass/subscriptions","organizations_url":"https://api.github.com/users/davglass/orgs","repos_url":"https://api.github.com/users/davglass/repos","events_url":"https://api.github.com/users/davglass/events{/privacy}","received_events_url":"https://api.github.com/users/davglass/received_events","type":"User","site_admin":false},"repo":{"id":7612484,"node_id":"MDEwOlJlcG9zaXRvcnk3NjEyNDg0","name":"license-checker","full_name":"davglass/license-checker","owner":{"login":"davglass","id":32551,"node_id":"MDQ6VXNlcjMyNTUx","avatar_url":"https://avatars2.githubusercontent.com/u/32551?v=4","gravatar_id":"","url":"https://api.github.com/users/davglass","html_url":"https://github.com/davglass","followers_url":"https://api.github.com/users/davglass/followers","following_url":"https://api.github.com/users/davglass/following{/other_user}","gists_url":"https://api.github.com/users/davglass/gists{/gist_id}","starred_url":"https://api.github.com/users/davglass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davglass/subscriptions","organizations_url":"https://api.github.com/users/davglass/orgs","repos_url":"https://api.github.com/users/davglass/repos","events_url":"https://api.github.com/users/davglass/events{/privacy}","received_events_url":"https://api.github.com/users/davglass/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/davglass/license-checker","description":"Check NPM package licenses","fork":false,"url":"https://api.github.com/repos/davglass/license-checker","forks_url":"https://api.github.com/repos/davglass/license-checker/forks","keys_url":"https://api.github.com/repos/davglass/license-checker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/davglass/license-checker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/davglass/license-checker/teams","hooks_url":"https://api.github.com/repos/davglass/license-checker/hooks","issue_events_url":"https://api.github.com/repos/davglass/license-checker/issues/events{/number}","events_url":"https://api.github.com/repos/davglass/license-checker/events","assignees_url":"https://api.github.com/repos/davglass/license-checker/assignees{/user}","branches_url":"https://api.github.com/repos/davglass/license-checker/branches{/branch}","tags_url":"https://api.github.com/repos/davglass/license-checker/tags","blobs_url":"https://api.github.com/repos/davglass/license-checker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/davglass/license-checker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/davglass/license-checker/git/refs{/sha}","trees_url":"https://api.github.com/repos/davglass/license-checker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/davglass/license-checker/statuses/{sha}","languages_url":"https://api.github.com/repos/davglass/license-checker/languages","stargazers_url":"https://api.github.com/repos/davglass/license-checker/stargazers","contributors_url":"https://api.github.com/repos/davglass/license-checker/contributors","subscribers_url":"https://api.github.com/repos/davglass/license-checker/subscribers","subscription_url":"https://api.github.com/repos/davglass/license-checker/subscription","commits_url":"https://api.github.com/repos/davglass/license-checker/commits{/sha}","git_commits_url":"https://api.github.com/repos/davglass/license-checker/git/commits{/sha}","comments_url":"https://api.github.com/repos/davglass/license-checker/comments{/number}","issue_comment_url":"https://api.github.com/repos/davglass/license-checker/issues/comments{/number}","contents_url":"https://api.github.com/repos/davglass/license-checker/contents/{+path}","compare_url":"https://api.github.com/repos/davglass/license-checker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/davglass/license-checker/merges","archive_url":"https://api.github.com/repos/davglass/license-checker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/davglass/license-checker/downloads","issues_url":"https://api.github.com/repos/davglass/license-checker/issues{/number}","pulls_url":"https://api.github.com/repos/davglass/license-checker/pulls{/number}","milestones_url":"https://api.github.com/repos/davglass/license-checker/milestones{/number}","notifications_url":"https://api.github.com/repos/davglass/license-checker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/davglass/license-checker/labels{/name}","releases_url":"https://api.github.com/repos/davglass/license-checker/releases{/id}","deployments_url":"https://api.github.com/repos/davglass/license-checker/deployments","created_at":"2013-01-14T20:53:59Z","updated_at":"2018-07-30T04:07:50Z","pushed_at":"2018-07-30T13:49:08Z","git_url":"git://github.com/davglass/license-checker.git","ssh_url":"git@github.com:davglass/license-checker.git","clone_url":"https://github.com/davglass/license-checker.git","svn_url":"https://github.com/davglass/license-checker","homepage":null,"size":404,"stargazers_count":677,"watchers_count":677,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":103,"mirror_url":null,"archived":false,"open_issues_count":31,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":103,"open_issues":31,"watchers":677,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/davglass/license-checker/pulls/169"},"html":{"href":"https://github.com/davglass/license-checker/pull/169"},"issue":{"href":"https://api.github.com/repos/davglass/license-checker/issues/169"},"comments":{"href":"https://api.github.com/repos/davglass/license-checker/issues/169/comments"},"review_comments":{"href":"https://api.github.com/repos/davglass/license-checker/pulls/169/comments"},"review_comment":{"href":"https://api.github.com/repos/davglass/license-checker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/davglass/license-checker/pulls/169/commits"},"statuses":{"href":"https://api.github.com/repos/davglass/license-checker/statuses/5e4b274e955485fb2aba37e65fec913b8042f38d"}},"author_association":"NONE","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"davglass","id":32551,"node_id":"MDQ6VXNlcjMyNTUx","avatar_url":"https://avatars2.githubusercontent.com/u/32551?v=4","gravatar_id":"","url":"https://api.github.com/users/davglass","html_url":"https://github.com/davglass","followers_url":"https://api.github.com/users/davglass/followers","following_url":"https://api.github.com/users/davglass/following{/other_user}","gists_url":"https://api.github.com/users/davglass/gists{/gist_id}","starred_url":"https://api.github.com/users/davglass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davglass/subscriptions","organizations_url":"https://api.github.com/users/davglass/orgs","repos_url":"https://api.github.com/users/davglass/repos","events_url":"https://api.github.com/users/davglass/events{/privacy}","received_events_url":"https://api.github.com/users/davglass/received_events","type":"User","site_admin":false},"comments":5,"review_comments":0,"maintainer_can_modify":false,"commits":3,"additions":44,"deletions":3,"changed_files":6}}
{"actor":{"display_login":"davglass"}}