Hi, for anyone interested, here a minimal port to Windows:
// index.js
import koffi from 'koffi';
const lib = koffi.load('user32.dll');
const MessageBoxW = lib.func('__stdcall', 'MessageBoxW', 'int', ['void *', 'str16', 'str16', 'uint']);
const MB_OK = 0x0;
const MB_ICONERROR = 0x10;
export default function errorDialog(error, title) {
error = error.stack || error;
title = title || '';
MessageBoxW(null, error, title, MB_OK | MB_ICONERROR);
}
Usage:
// demo.mjs
import errorDialog from 'error-dialog';
const error = new Error('Expected more unicorns!');
errorDialog(error, 'π¦');
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too