Skip to content

Commit

Permalink
Merge pull request #5 from kratos-mc/add/usage-examples
Browse files Browse the repository at this point in the history
Add usage example
  • Loading branch information
PlayerNguyen authored Feb 9, 2023
2 parents 93e04d9 + 0d8c060 commit 929435c
Show file tree
Hide file tree
Showing 3 changed files with 223 additions and 0 deletions.
14 changes: 14 additions & 0 deletions examples/fetch-version/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const {
fetchVersionManifestV2,
VersionManifestUtils,
} = require("kratos-api-engine/dist/Manifest");

(async () => {
const manifest = await fetchVersionManifestV2();

const utils = new VersionManifestUtils(manifest);

console.log(
`The latest minecraft version now is ${utils.getLatestRelease()}`
);
})().catch(console.error);
193 changes: 193 additions & 0 deletions examples/fetch-version/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions examples/fetch-version/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "fetch-version",
"version": "1.0.0",
"description": "",
"main": "index.js",
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"kratos-api-engine": "^1.0.0"
}
}

0 comments on commit 929435c

Please sign in to comment.