pimi-launcher-core/components/utils.js
2023-06-18 18:52:39 +03:00

36 lines
713 B
JavaScript

const axios = require("axios");
async function getVersions() {
return (
await axios.get(
"https://launchermeta.mojang.com/mc/game/version_manifest_v2.json"
)
).data.versions;
}
async function getLatestVersion() {
return getVersions()[0];
}
async function getLatestRelease() {
return (
await axios.get(
"https://launchermeta.mojang.com/mc/game/version_manifest_v2.json"
)
).data.latest.release;
}
async function getLatestSnapshot() {
return (
await axios.get(
"https://launchermeta.mojang.com/mc/game/version_manifest_v2.json"
)
).data.latest.snapshot;
}
module.exports = {
getVersions,
getLatestVersion,
getLatestRelease,
getLatestSnapshot,
};