mirror of
https://github.com/artegoser/pimi-launcher-core.git
synced 2024-11-06 05:33:58 +03:00
37 lines
713 B
JavaScript
37 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,
|
||
|
};
|