{"action":"opened","issue":{"url":"https://api.github.com/repos/npm/npm/issues/12553","repository_url":"https://api.github.com/repos/npm/npm","labels_url":"https://api.github.com/repos/npm/npm/issues/12553/labels{/name}","comments_url":"https://api.github.com/repos/npm/npm/issues/12553/comments","events_url":"https://api.github.com/repos/npm/npm/issues/12553/events","html_url":"https://github.com/npm/npm/issues/12553","id":152717337,"number":12553,"title":"Does NPM support virtual packages? Is it possible to depend on either package A or B?","user":{"login":"wigy-opensource-developer","id":1888808,"avatar_url":"https://avatars.githubusercontent.com/u/1888808?v=3","gravatar_id":"","url":"https://api.github.com/users/wigy-opensource-developer","html_url":"https://github.com/wigy-opensource-developer","followers_url":"https://api.github.com/users/wigy-opensource-developer/followers","following_url":"https://api.github.com/users/wigy-opensource-developer/following{/other_user}","gists_url":"https://api.github.com/users/wigy-opensource-developer/gists{/gist_id}","starred_url":"https://api.github.com/users/wigy-opensource-developer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wigy-opensource-developer/subscriptions","organizations_url":"https://api.github.com/users/wigy-opensource-developer/orgs","repos_url":"https://api.github.com/users/wigy-opensource-developer/repos","events_url":"https://api.github.com/users/wigy-opensource-developer/events{/privacy}","received_events_url":"https://api.github.com/users/wigy-opensource-developer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-03T07:43:54Z","updated_at":"2016-05-03T07:43:54Z","closed_at":null,"body":"The Debian Package Management system has a great feature that a package can `provide` a [virtual package][1] that other packages can depend on. A great example is the [mail-transport-agent][2] package that is implemented by 25 other packages.\r\n\r\nNow back to NPM, say, I want to reinvent the wheel by writing a [webpack loader][3] that uses either [sass-loader][4] or [less-loader][5] to transform parts of my own file format into `CSS`. If I just naively go ahead, the users of my package will depend on both `sass-loader` and `less-loader` although they probably only use one of them.\r\n\r\nI want to give the users of my loader package the choice to have either `sass-loader` or `less-loader` or both in their package, but I want to warn them if neither of them are installed. Is there a way or a workaround for this?\r\n\r\n(I am cross-posting this from http://stackoverflow.com/questions/36917564 to see if I can get feedback here easier from the community.)\r\n\r\n  [1]: https://www.debian.org/doc/debian-policy/ch-relationships.html#s-virtual\r\n  [2]: https://packages.debian.org/jessie/mail-transport-agent\r\n  [3]: http://webpack.github.io/docs/list-of-loaders.html\r\n  [4]: https://github.com/jtangelder/sass-loader\r\n  [5]: https://github.com/webpack/less-loader"}}