package
A collection of npm packages utils 🗃 ..
npm install packages-versionsGitHub-flavored package documentation.
Across all versions, last 30 days.
138 in 30 days
Runtime metadata.
Tagged topics.
Estimated unpacked size across 2 packages.
135.4 kB
Includes dependencies.
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 🎮.
Installation# npm ..
$ npm install packages-versions
# yarn ..
$ yarn add packages-versionsUsageThis 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 {
Options Ref.| Option | Type | Descriptio |
|---|---|---|
reverse | Boolean | Reverse the order of the results (versions array). |
extract | Object | Extract only the type of version you want. |
Note: extract can contain one, some or all of these values in a boolean form (pure: X.X.X, rc: X.X.X-rc, beta: X.X.X-beta, alpha: X.X.X-alpha).
You can combine
reverseandextract.
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!