dpkg / APT has supported this for ages.
There are two mechanisms for this. One is alternate dependencies by simply declaring the dependency like this:
Depends: jquery | zeptojs
You will declare that the package depends on either
The other mechanism is Virtual Packages. A package can declare that it
Provides a virtual package and then other packages can depend on that virtual package.
For example, both the
jquery package and the
zeptojs package can declare that they provide the
jquery-api virtual package, and then your app can depend on
jquery-api. This has the added advantage that if in the future a third new JQuery-compatible library appears in the market, only the author of that package has to put a
Provides: jquery-api line in his package description. You don't have to change your app and it will just work with the new library.
In your app:
In the brand-new yet-to-be-written awesome new JQuery replacement: