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.
pnpm add earthmc
View the full documentation here.
import { Aurora } from 'earthmc' // ESM
const { Aurora } = require('earthmc') // CJS
const towns = await Aurora.Towns.all().catch(console.error)
console.log(towns.length)
<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>