{"id":39623519,"url":"https://github.com/ooxml-tools/units","last_synced_at":"2026-01-18T08:31:24.531Z","repository":{"id":274508319,"uuid":"896885910","full_name":"ooxml-tools/units","owner":"ooxml-tools","description":"Office Open XML unit conversion functions in nodejs/browser","archived":false,"fork":false,"pushed_at":"2026-01-14T20:03:07.000Z","size":321,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-15T00:21:53.706Z","etag":null,"topics":["docx","ooxml","pptx","xlsx"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ooxml-tools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-01T14:48:38.000Z","updated_at":"2026-01-14T20:01:58.000Z","dependencies_parsed_at":"2026-01-14T22:21:52.943Z","dependency_job_id":null,"html_url":"https://github.com/ooxml-tools/units","commit_stats":null,"previous_names":["ooxml-tools/units"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/ooxml-tools/units","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ooxml-tools%2Funits","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ooxml-tools%2Funits/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ooxml-tools%2Funits/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ooxml-tools%2Funits/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ooxml-tools","download_url":"https://codeload.github.com/ooxml-tools/units/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ooxml-tools%2Funits/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28534148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["docx","ooxml","pptx","xlsx"],"created_at":"2026-01-18T08:31:23.838Z","updated_at":"2026-01-18T08:31:24.515Z","avatar_url":"https://github.com/ooxml-tools.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003e\n    \u003cpicture\u003e\n        \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://ooxml-tools.github.io/design/images/units-dark.png\"\u003e\n        \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://ooxml-tools.github.io/design/images/units-light.png\"\u003e\n        \u003cimg alt=\"@ooxml-tools/units\" height=\"56\" src=\"https://ooxml-tools.github.io/design/images/units-light.png\"\u003e\n    \u003c/picture\u003e\n\u003c/h1\u003e\n\nConversion for the strange and wonderful Office Open XML units\n\nSupports conversion from `cm` to\n\n- `twip`\n- `dxa`\n- `emu`\n- `inch`\n\n### DXA\n\nFrom Ecma Office Open XML Part 1 - Fundamentals And Markup Language Reference.pdf (page 1503)\n\nSpecifies that the value for the measurement of the current table width property in the parent table shall be interpreted as twentieths of a point (1/1440 of an inch).\n\n### Twips\n\nFrom Ecma Office Open XML Part 1 - Fundamentals And Markup Language Reference.pdf (page 1587)\n\nUnits for window widths and other dimensions are expressed in twips. Twip measurements are portable between different display resolutions. The formula is (screen pixels) _ (20 _ 72) / (logical device dpi), where the logical device dpi can be different for x and y coordinates.\n\n### EMU\n\nFrom Ecma Office Open XML Part 1 - Fundamentals And Markup Language Reference.pdf (page 2728)\n\nThroughout ECMA-376, the EMU is used as a unit of measurement for length. An EMU is defined as follows:\n\n```\n1 emu = 1/914400 US inch = 1/360000 cm\n```\n\n[Rationale: The EMU was created in order to be able to evenly divide in both English and Metric units, in order to avoid rounding errors during the calculation. The usage of EMUs also facilitates a more seamless system switch and interoperability between different locales utilizing different units of measurement. EMUs define an integer based, high precision coordinate system. end rationale]\n\n## API\n\n- `cmToTwip(number)`/`twipToCm(number)`\n- `cmToDxa(number)`/`dxaToCm(number)`\n- `cmToEmu(number)`/`emuToCm(number)`\n- `cmToInch(number)`/`inchToCm(number)`\n- `pointToDxa(number)`/`dxaToPoint(number)`\n- `toOoDegree(number)`/`fromOoDegree(number)`\n- `cartesianToExcelCoords(number,number)`/`excelToCartesianCoords(string)`\n- `pxToColumnWidth(number, maximumDigitWidth)`/`columnWidthToPx(number, maximumDigitWidth)`\n\n## CLI\n\n```bash\nnpx @ooxml-tools/units --help\n# ooxml-units \u003ccommand\u003e [args]\n#\n# Commands:\n#   convert \u003cfrom\u003e \u003cto\u003e \u003cvalue\u003e  convert between units\n#   list                         list valid formats\n#\n# Options:\n#   --version  Show version number                                       [boolean]\n#   --help     Show help                                                 [boolean]\n#\n# Examples:\n#   ooxml-units convert \u003cfrom\u003e \u003cto\u003e \u003cvalue\u003e\n```\n\n## CI\n\n[![codecov](https://codecov.io/gh/ooxml-tools/units/graph/badge.svg?token=GYOUNVV2JW)](https://codecov.io/gh/ooxml-tools/units)\n\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fooxml-tools%2Funits","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fooxml-tools%2Funits","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fooxml-tools%2Funits/lists"}