{"_id":"calculate-size","_rev":"135258","name":"calculate-size","description":"Calculate the pixel size of a string","dist-tags":{"latest":"1.1.1"},"maintainers":[{"name":"schickling","email":"schickling.j@gmail.com"}],"time":{"modified":"2021-06-03T11:18:20.000Z","created":"2015-05-25T19:03:33.452Z","1.1.1":"2016-12-08T10:13:05.427Z","1.1.0":"2016-12-08T10:07:13.565Z","1.0.2":"2016-12-07T16:24:49.732Z","1.0.1":"2016-12-07T16:22:11.289Z","1.0.0":"2016-12-07T16:14:25.132Z","0.2.0":"2016-05-19T12:22:01.942Z","0.1.0":"2015-05-25T19:03:33.452Z"},"users":{},"author":{"name":"Johannes Schickling","email":"schickling.j@gmail.com","url":"https://github.com/schickling"},"repository":{"type":"git","url":"git+https://github.com/schickling/calculate-size.git"},"versions":{"1.1.1":{"name":"calculate-size","version":"1.1.1","description":"Calculate the pixel size of a string","main":"lib/index.js","types":"lib/index.d.ts","scripts":{"test":"ava -s test/index.js","prepublish":"npm run build","build":"rm -rf lib && tsc"},"files":["lib"],"repository":{"type":"git","url":"git+https://github.com/schickling/calculate-size.git"},"keywords":["font","calculate","size","width","height","dimension"],"author":{"name":"Johannes Schickling","email":"schickling.j@gmail.com","url":"https://github.com/schickling"},"license":"MIT","bugs":{"url":"https://github.com/schickling/calculate-size/issues"},"homepage":"https://github.com/schickling/calculate-size","devDependencies":{"ava":"^0.17.0","express":"^4.14.0","nightmare":"^2.8.1","typescript":"^2.0.10"},"gitHead":"a524c5a3cf736bd574dc8a878a81678417c08b70","_id":"calculate-size@1.1.1","_shasum":"ae7caa1c7795f82c4f035dc7be270e3581dae3ee","_from":".","_npmVersion":"3.10.8","_nodeVersion":"7.0.0","_npmUser":{"name":"schickling","email":"schickling.j@gmail.com"},"dist":{"shasum":"ae7caa1c7795f82c4f035dc7be270e3581dae3ee","size":2726,"noattachment":false,"key":"/calculate-size/-/calculate-size-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/calculate-size/download/calculate-size-1.1.1.tgz"},"maintainers":[{"name":"schickling","email":"schickling.j@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/calculate-size-1.1.1.tgz_1481191983777_0.7354384313803166"},"directories":{},"publish_time":1481191985427,"_cnpm_publish_time":1481191985427,"_hasShrinkwrap":false},"1.1.0":{"name":"calculate-size","version":"1.1.0","description":"Calculate the pixel size of a string","main":"lib/index.js","types":"lib/index.d.ts","scripts":{"test":"ava -s test/index.js","prepublish":"npm run build","build":"rm -rf lib && tsc"},"files":["lib"],"repository":{"type":"git","url":"git+https://github.com/schickling/calculate-size.git"},"keywords":["font","calculate","size","width","height","dimension"],"author":{"name":"Johannes Schickling","email":"schickling.j@gmail.com","url":"https://github.com/schickling"},"license":"MIT","bugs":{"url":"https://github.com/schickling/calculate-size/issues"},"homepage":"https://github.com/schickling/calculate-size","devDependencies":{"ava":"^0.17.0","express":"^4.14.0","nightmare":"^2.8.1","typescript":"^2.0.10"},"gitHead":"45accdbb83107f39953cbd2c1862f460cde1f55b","_id":"calculate-size@1.1.0","_shasum":"1d3399bd65178e53db7ba77f89209391f4de4685","_from":".","_npmVersion":"3.10.8","_nodeVersion":"7.0.0","_npmUser":{"name":"schickling","email":"schickling.j@gmail.com"},"dist":{"shasum":"1d3399bd65178e53db7ba77f89209391f4de4685","size":2806,"noattachment":false,"key":"/calculate-size/-/calculate-size-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/calculate-size/download/calculate-size-1.1.0.tgz"},"maintainers":[{"name":"schickling","email":"schickling.j@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/calculate-size-1.1.0.tgz_1481191632969_0.898003293434158"},"directories":{},"publish_time":1481191633565,"_cnpm_publish_time":1481191633565,"_hasShrinkwrap":false},"1.0.2":{"name":"calculate-size","version":"1.0.2","description":"Calculate the pixel size of a string","main":"lib/index.js","types":"lib/index.d.ts","scripts":{"test":"ava -s test/index.js","prepublish":"npm run build","build":"rm -rf lib && tsc"},"files":["lib"],"repository":{"type":"git","url":"git+https://github.com/schickling/calculate-size.git"},"keywords":["font","calculate","size","width","height","dimension"],"author":{"name":"Johannes Schickling","email":"schickling.j@gmail.com","url":"https://github.com/schickling"},"license":"MIT","bugs":{"url":"https://github.com/schickling/calculate-size/issues"},"homepage":"https://github.com/schickling/calculate-size","devDependencies":{"ava":"^0.17.0","express":"^4.14.0","nightmare":"^2.8.1","typescript":"^2.0.10"},"gitHead":"17ac7a8da9418983d98879e8ae8c18e0a6a631ce","_id":"calculate-size@1.0.2","_shasum":"6112c503859b769739c14a65567876f9a8cf79c7","_from":".","_npmVersion":"3.10.8","_nodeVersion":"7.0.0","_npmUser":{"name":"schickling","email":"schickling.j@gmail.com"},"dist":{"shasum":"6112c503859b769739c14a65567876f9a8cf79c7","size":2781,"noattachment":false,"key":"/calculate-size/-/calculate-size-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/calculate-size/download/calculate-size-1.0.2.tgz"},"maintainers":[{"name":"schickling","email":"schickling.j@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/calculate-size-1.0.2.tgz_1481127889069_0.9929834790527821"},"directories":{},"publish_time":1481127889732,"_cnpm_publish_time":1481127889732,"_hasShrinkwrap":false},"1.0.1":{"name":"calculate-size","version":"1.0.1","description":"Calculate the pixel size of a string","main":"lib/index.js","types":"lib/index.d.ts","scripts":{"test":"ava -s test/index.js","prepublish":"npm run build","build":"rm -rf lib && tsc"},"repository":{"type":"git","url":"git+https://github.com/schickling/calculate-size.git"},"keywords":["font","calculate","size","width","height","dimension"],"author":{"name":"Johannes Schickling","email":"schickling.j@gmail.com","url":"https://github.com/schickling"},"license":"MIT","bugs":{"url":"https://github.com/schickling/calculate-size/issues"},"homepage":"https://github.com/schickling/calculate-size","devDependencies":{"ava":"^0.17.0","express":"^4.14.0","nightmare":"^2.8.1","typescript":"^2.0.10"},"gitHead":"b522b9040083f6f9e7717f8edf15d6ba873d731c","_id":"calculate-size@1.0.1","_shasum":"1d88a8f4560a3d7367eeb96c34de020411098ef1","_from":".","_npmVersion":"3.10.8","_nodeVersion":"7.0.0","_npmUser":{"name":"schickling","email":"schickling.j@gmail.com"},"dist":{"shasum":"1d88a8f4560a3d7367eeb96c34de020411098ef1","size":53562,"noattachment":false,"key":"/calculate-size/-/calculate-size-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/calculate-size/download/calculate-size-1.0.1.tgz"},"maintainers":[{"name":"schickling","email":"schickling.j@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/calculate-size-1.0.1.tgz_1481127730634_0.23683755239471793"},"directories":{},"publish_time":1481127731289,"_cnpm_publish_time":1481127731289,"_hasShrinkwrap":false},"1.0.0":{"name":"calculate-size","version":"1.0.0","description":"Calculate the pixel size of a string","main":"lib/index.js","types":"lib/index.d.ts","scripts":{"test":"ava -s test/index.js","prepublish":"npm run build","build":"tsc"},"repository":{"type":"git","url":"git+https://github.com/schickling/calculate-size.git"},"keywords":["font","calculate","size","width","height","dimension"],"author":{"name":"Johannes Schickling","email":"schickling.j@gmail.com","url":"https://github.com/schickling"},"license":"MIT","bugs":{"url":"https://github.com/schickling/calculate-size/issues"},"homepage":"https://github.com/schickling/calculate-size","devDependencies":{"ava":"^0.17.0","express":"^4.14.0","nightmare":"^2.8.1","typescript":"^2.0.10"},"gitHead":"5b47404cc5f89f4d1cd00080b5418ef5dbd4d1e3","_id":"calculate-size@1.0.0","_shasum":"65f1bb33733534d4a266b6be6228ed03624e06a6","_from":".","_npmVersion":"3.10.8","_nodeVersion":"7.0.0","_npmUser":{"name":"schickling","email":"schickling.j@gmail.com"},"dist":{"shasum":"65f1bb33733534d4a266b6be6228ed03624e06a6","size":59310,"noattachment":false,"key":"/calculate-size/-/calculate-size-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/calculate-size/download/calculate-size-1.0.0.tgz"},"maintainers":[{"name":"schickling","email":"schickling.j@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/calculate-size-1.0.0.tgz_1481127264479_0.4497378231026232"},"directories":{},"publish_time":1481127265132,"_cnpm_publish_time":1481127265132,"_hasShrinkwrap":false},"0.2.0":{"name":"calculate-size","version":"0.2.0","description":"Calculate the pixel size of a string","main":"src/calculate-size.js","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"git+https://github.com/schickling/calculate-size.git"},"keywords":["font","calculate","size","width","height","dimension"],"author":{"name":"Johannes Schickling","email":"schickling.j@gmail.com","url":"https://github.com/schickling"},"license":"MIT","bugs":{"url":"https://github.com/schickling/calculate-size/issues"},"homepage":"https://github.com/schickling/calculate-size","devDependencies":{"casperjs":"~1.1.0-beta3","grunt":"^1.0.1","grunt-casper":"~0.3.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"~0.7.0","load-grunt-tasks":"~0.3.0","phantomjs":"~1.9.7-1"},"gitHead":"5b47404cc5f89f4d1cd00080b5418ef5dbd4d1e3","_id":"calculate-size@0.2.0","_shasum":"3350ab1bfb70dd4d7bd425da4851bb72cbae79aa","_from":".","_npmVersion":"3.8.3","_nodeVersion":"5.10.1","_npmUser":{"name":"schickling","email":"schickling.j@gmail.com"},"dist":{"shasum":"3350ab1bfb70dd4d7bd425da4851bb72cbae79aa","size":2982,"noattachment":false,"key":"/calculate-size/-/calculate-size-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/calculate-size/download/calculate-size-0.2.0.tgz"},"maintainers":[{"name":"schickling","email":"schickling.j@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/calculate-size-0.2.0.tgz_1463660518861_0.053769628051668406"},"directories":{},"publish_time":1463660521942,"_cnpm_publish_time":1463660521942,"_hasShrinkwrap":false},"0.1.0":{"name":"calculate-size","version":"0.1.0","description":"Calculate the pixel size of a string","main":"src/calculate-size.js","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"https://github.com/schickling/calculate-size.git"},"keywords":["font","calculate","size","width","height","dimension"],"author":{"name":"Johannes Schickling","email":"schickling.j@gmail.com","url":"https://github.com/schickling"},"license":"MIT","bugs":{"url":"https://github.com/schickling/calculate-size/issues"},"homepage":"https://github.com/schickling/calculate-size","devDependencies":{"grunt":"~0.4.2","grunt-casper":"~0.3.0","grunt-contrib-connect":"~0.7.0","load-grunt-tasks":"~0.3.0","casperjs":"~1.1.0-beta3","phantomjs":"~1.9.7-1"},"gitHead":"2b8caad797b4091d19a4a566eb7ef0e6952c1fac","_id":"calculate-size@0.1.0","_shasum":"5c4b0576c30b502c36dab0fc4b6240a92784c678","_from":".","_npmVersion":"2.7.5","_nodeVersion":"0.12.2","_npmUser":{"name":"schickling","email":"schickling.j@gmail.com"},"maintainers":[{"name":"schickling","email":"schickling.j@gmail.com"}],"dist":{"shasum":"5c4b0576c30b502c36dab0fc4b6240a92784c678","size":2966,"noattachment":false,"key":"/calculate-size/-/calculate-size-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/calculate-size/download/calculate-size-0.1.0.tgz"},"directories":{},"publish_time":1432580613452,"_cnpm_publish_time":1432580613452,"_hasShrinkwrap":false}},"readme":"calculate-size [![Build Status](https://travis-ci.org/schickling/calculate-size.svg?branch=master)](https://travis-ci.org/schickling/calculate-size) [![npm version](https://badge.fury.io/js/calculate-size.svg)](https://badge.fury.io/js/calculate-size)\n==============\n\nCalculate the pixel size (width/height) of a string (with integrated caching)\n\n## Install\n\n> This package supports Typescript out-of-the-box\n\n```sh\n$ npm install calculate-size\n```\n\n## Usage\n\n```js\nconst size = calculateSize('Hello world!', {\n   font: 'Arial',\n   fontSize: '12px'\n})\n\n### Options\n\n* `font: string`\n* `fontSize: string`\n* `fontWeight: string`\n* `width: string` (Constraint width by a fixed value to calc height)\n\nconsole.log(size.width) // 140\nconsole.log(size.height) // 20\n```\n","_attachments":{},"homepage":"https://github.com/schickling/calculate-size","bugs":{"url":"https://github.com/schickling/calculate-size/issues"},"license":"MIT"}