EarthMC-Toolkit / EarthMC-NPM

An NPM package providing info on the EarthMC Minecraft server.

Home Page:https://npmjs.com/package/earthmc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EarthMC-NPM

An unofficial wrapper library for interacting with the EarthMC Dynmap API.
This package is part of the EarthMC Toolkit and provides extensive info on people, places and more.

Install

pnpm add earthmc

Basic Usage

View the full documentation here.

Node

import { Aurora } from 'earthmc' // ESM
const { Aurora } = require('earthmc') // CJS

const towns = await Aurora.Towns.all().catch(console.error)
console.log(towns.length)

Browser

<button onclick="townAmount()">Show town amount</button>

<script type="module" src="https://unpkg.com/earthmc@latest/dist/main.js"></script>
<script>
import { Aurora } from 'earthmc'

window.townAmount = async function() {
  try {
    const towns = await Aurora.Towns.all()
    alert(towns.length)
  }
  catch(e) {
    console.error(e)
  }
}
</script>

About

An NPM package providing info on the EarthMC Minecraft server.

https://npmjs.com/package/earthmc


Languages

Language:TypeScript 97.6%Language:JavaScript 2.4%