wplace-api
v0.1.2
Published
Unofficial library to interact with the Wplace.live backend API
Downloads
20
Readme
Wplace API
Unofficial library to interact with the Wplace.live backend API
Docs
https://jsr.io/@j0code/wplace-api/doc
Install
JSR (node.js)
npx jsr add @j0code/wplace-apiJSR (Deno)
deno add jsr:@j0code/wplace-apiJSR (Bun)
bunx jsr add @j0code/wplace-apiNPM
npm i wplace-apiUsage Example
import WplaceAPI from "@j0code/wplace-api"
const api = new WplaceAPI()
const pixel = await api.getPixel(1, 2, 3, 4) // get pixel 3;4 from tile 1;2
console.log(pixel)
/* prints:
{
paintedBy: {
id: ...,
name: '...',
allianceId: 0,
allianceName: '',
equippedFlag: 0
},
region: { id: 0, cityId: 6919, name: 'Anchorage', number: 1, countryId: 235 }
}
*/
const tile = await api.getTile(1, 2) // get tile 1;2 as a pngjs PNG instance
await api.downloadTile(1, 2, "tile.png") // downloads tile 1;2 and saves it in ./tile.png
