Reads Mudlet's map binary file (v20 only!). Can output .js files needed for Mudlet Map Reader. Mudlet map JSON format is yet unsupported.
npm install mudlet-map-binary-reader1.0.0 is subject to change! Use with caution.
js
const { MudletMapReader } = require("mudlet-map-binary-reader");
const inputFile = "map.dat"
const outputDirectory = "output";
let mapModel = MudletMapReader.read(inputFile);
// Export to map renderer format and save to .js and .json files https://github.com/Delwing/js-mudlet-map-renderer
let { mudletMap, colors } = MudletMapReader.export(mapModel, outputDirectory);
// Export as Mudlet Json map
const outputFile = 'file.json'
let mudletJsonFormat = MudletMapReader.exportJson(mapModel, outputFile)
//Modify and save binary
mapModel.rooms[1].name = "Funny name!"
MudletMapReader.write(mapModel, inputFile)
``