I have an NPM package that depends on cheerio. Cheerio 0.22.0 has a 1 MB install size (according to Package Phobia) while 1.0.0-rc1 is 2.68 MB. For that reason, if whoever depends on my package does not already have cheerio ^1.0.0-rc1 in their dependency tree, I would like NPM to install cheerio ^0.22.0. If they do have ^1.0.0-rc1, I would like to use that.
Is this possible? I’ve tried depending on:
"cheerio": "^0.22.0||^1.0.0-rc1" and
"cheerio": "^1.0.0-rc1||^0.22.0" but both install ^1.0.0-rc1 if cheerio is not already installed.