This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { loadImage, createCanvas } from 'canvas' | |
import fs from 'fs' | |
const fse = fs.promises; | |
console.time('paint') | |
const posFile = JSON.parse((await fse.readFile('./scene3_worldArea.json')).toString()); | |
const img = await loadImage('./Teyvat_Map_3.4.png') | |
const blockSize = 1024; | |
const offset = [0, 0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @file import compiled ES modules as a workaround | |
*/ | |
const esm = require('esm') | |
const fs = require('fs') | |
const Module = require('module') | |
// Node: bypass [ERR_REQUIRE_ESM] |