GET ALL VERSIONS OF ANY PACKAGES 🗃 ..
I don't intend to make breaking changes to this package 🙌🏻. So, don't be afraid to upgrade ✨.
I added Opts argument (Optional) to the function for give you more control 🎮.
This is a practical example of how to use.
// you can use any name for this function.
// the result is an array of versions in descending order.
const getPackagesVersions = require ('packages-versions');
// note: you can use the promise way (then/catch)
(async () => {
try {
let list = await getPackagesVersions('packages-versions');
console.log(list);
}catch(err){
console.log(err)
}
})();
// Result:
// [ '2.1.0', '2.0.0', '1.1.1', '1.1.0', '1.0.1', '1.0.0' ]
// the same example with reverse opt.
(async () => {
try {
You can combine reverse and extract.