probe.mjs 477 Bytes
const log = console.log;
import('sharp')
    .then((m) => {
        log('SHARP_OK type=', typeof m.default);
        const s = m.default;
        s({ create: { width: 8, height: 8, channels: 3, background: { r: 255, g: 0, b: 0 } } })
            .resize(4, 4)
            .png()
            .toBuffer()
            .then((b) => log('RESIZE_OK bytes=', b.length))
            .catch((e) => log('RESIZE_FAIL', e.message));
    })
    .catch((e) => log('SHARP_FAIL', e.message));