node-measure-text-width

1.0.1 • Public • Published

node-measure-text-width

Install

$ npm i node-measure-text-width

Usage

const measureTextWidth = require("node-measure-text-width");

(async function () {
  console.time("measureTextWidth");
  const width = await measureTextWidth(
    "The quick brown fox jumps over the lazy dog.",
    "12px serif"
  );
  console.timeEnd("measureTextWidth"); // 1.083ms
  console.log(width); // 222.28125
})();

Readme

Keywords

Package Sidebar

Install

npm i node-measure-text-width

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

2.9 kB

Total Files

4

Last publish

Collaborators

  • hanai