Last active
January 3, 2017 14:58
-
-
Save adambisek/2f996dc418d18ae214ee4e0a0f2f84d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pixelWidth = require('string-pixel-width').default; | |
var width = pixelWidth('My text ...', { size: 10 }); | |
console.log('This text has width ' + width + 'px in the size of 10px.'); | |
// "This text has width 43.5px in the size of 10px." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment