EarthMC-NPM

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>