How to use npm koffi to change change desktop wallpaper?

It would be great if there is detailed code

This is other codes

const ffi = require("ffi-napi");
const wchar_t = require("ref-wchar-napi");

var wchar_string = wchar_t.string;

const lib = ffi.Library("user32", {
  SystemParametersInfoW: ["int", ["uint", "uint", wchar_string, "uint"]],
});

const SPI_SETDESKWALLPAPER = 20;

export function setWallpaper(pathString: string) {
  lib.SystemParametersInfoW(
    SPI_SETDESKWALLPAPER,
    0,
    pathString,
    0
  );
}

Thanks very much!