constmeasureTextWidth=require("node-measure-text-width");(asyncfunction(){console.time("measureTextWidth");constwidth=awaitmeasureTextWidth("The quick brown fox jumps over the lazy dog.","12px serif");console.timeEnd("measureTextWidth");// 1.083msconsole.log(width);// 222.28125})();