From dcf147167d767d1478c183c76a8d9dd025adb46e Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 15 Apr 2024 09:02:07 +0100 Subject: [PATCH] update readme --- .gitea/workflows/publish.yml | 5 +++++ README.md | 20 +++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/publish.yml b/.gitea/workflows/publish.yml index 942fa4b..888ee51 100644 --- a/.gitea/workflows/publish.yml +++ b/.gitea/workflows/publish.yml @@ -2,6 +2,11 @@ name: Publish Package on: push: branches: [master] + paths-ignore: + - .gitignore + - README.md + - LICENSE + jobs: build: runs-on: ubuntu-latest diff --git a/README.md b/README.md index 23b6ba2..2d5afe3 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,25 @@ Install the package using npm: npm install mcutils-library ``` -Fetch data from a player: +Get player: ```javascript -import mcUtils from "mcutils-library"; +import { getPlayer } from "mcutils-library"; + +const cachedPlayer = await getPlayer(playerId); +const { player } = cachedPlayer; -const { player } = await mcUtils.player.getPlayer("Notch"); console.log(player); ``` + +Get Server: + +```javascript +import { getServer } from "mcutils-library"; +import JavaMinecraftServer from "mcutils-library/dist/types/server/javaServer"; + +const cachedServer = await getServer(ServerPlatform.Java, "hypixel.net"); +const { server } = cachedServer; + +console.log(server); +```