This commit is contained in:
parent
516c3a373d
commit
dcf147167d
@ -2,6 +2,11 @@ name: Publish Package
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
paths-ignore:
|
||||
- .gitignore
|
||||
- README.md
|
||||
- LICENSE
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
20
README.md
20
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);
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user