{"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","tarball":"http://registry-npm.ywwl.com/calculate-size/download/calculate-size-1.0.1.tgz","integrity":"sha512-1qhgLRBcyx2wMHFICVOyiaheRjr2yGZzmNLJ5gwHaOJUliMDUqyf1sdf70dLUpNNM8smlEEd5OU4nURSw76Whg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDknTb4wyKxZk0U5JgOu7uZ9fncTXX/HKEE4ma6F71K2AiApC5I6SRnnFFdozBPua9xj3ctDpkJEh/enMuRdN3hnHA=="}],"size":53562,"noattachment":false,"key":"/calculate-size/-/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":{},"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","publish_time":1481127731289,"_cnpm_publish_time":1481127731289,"dist-tags":{"latest":"1.1.1"}}