{"id":15579811,"url":"https://github.com/schickling/calculate-size","last_synced_at":"2025-04-04T21:07:45.199Z","repository":{"id":14158669,"uuid":"16864542","full_name":"schickling/calculate-size","owner":"schickling","description":"Calculate the pixel size (width/height) of a string (with integrated caching)","archived":false,"fork":false,"pushed_at":"2018-05-27T19:06:50.000Z","size":83,"stargazers_count":121,"open_issues_count":8,"forks_count":19,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-28T20:07:07.640Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/schickling.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-15T14:42:10.000Z","updated_at":"2024-06-04T21:30:18.000Z","dependencies_parsed_at":"2022-08-30T16:11:24.997Z","dependency_job_id":null,"html_url":"https://github.com/schickling/calculate-size","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schickling%2Fcalculate-size","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schickling%2Fcalculate-size/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schickling%2Fcalculate-size/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schickling%2Fcalculate-size/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/schickling","download_url":"https://codeload.github.com/schickling/calculate-size/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249524,"owners_count":20908212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T19:21:16.926Z","updated_at":"2025-04-04T21:07:45.179Z","avatar_url":"https://github.com/schickling.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"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\u003e 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* `lineHeight: 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschickling%2Fcalculate-size","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschickling%2Fcalculate-size","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschickling%2Fcalculate-size/lists"}