{"id":22635732,"url":"https://github.com/mattfors/ng-scales","last_synced_at":"2026-02-19T13:01:34.012Z","repository":{"id":241410580,"uuid":"805919345","full_name":"mattfors/ng-scales","owner":"mattfors","description":"Angular library for reading USB scales","archived":false,"fork":false,"pushed_at":"2025-11-29T11:31:36.000Z","size":1837,"stargazers_count":2,"open_issues_count":11,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-01T12:54:39.882Z","etag":null,"topics":["angular","dymo","hid","scales","usb"],"latest_commit_sha":null,"homepage":"https://mattfors.github.io/ng-scales/","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/mattfors.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-25T21:02:37.000Z","updated_at":"2025-08-07T12:02:39.000Z","dependencies_parsed_at":"2024-05-28T07:42:46.555Z","dependency_job_id":"fc107979-665b-4a83-ad33-bc5f99921396","html_url":"https://github.com/mattfors/ng-scales","commit_stats":null,"previous_names":["mattfors/ng-scales"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mattfors/ng-scales","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattfors%2Fng-scales","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattfors%2Fng-scales/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattfors%2Fng-scales/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattfors%2Fng-scales/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattfors","download_url":"https://codeload.github.com/mattfors/ng-scales/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattfors%2Fng-scales/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29614589,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T10:52:55.328Z","status":"ssl_error","status_checked_at":"2026-02-19T10:52:26.323Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["angular","dymo","hid","scales","usb"],"created_at":"2024-12-09T03:14:22.722Z","updated_at":"2026-02-19T13:01:33.968Z","avatar_url":"https://github.com/mattfors.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ng-scales\n[![npm version](https://badge.fury.io/js/ng-scales.svg)](https://badge.fury.io/js/ng-scales)\n![workflow](https://github.com/mattfors/ng-scales/actions/workflows/main.yml/badge.svg)\n![Coverage](https://mattfors.github.io/ng-scales/coverage-badges.svg)\n![code ql](https://github.com/mattfors/ng-scales/actions/workflows/codeql.yml/badge.svg)\n![Known Vulnerabilities](https://snyk.io/test/github/mattfors/ng-scales/badge.svg)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n\n\nAngular library for connecting to USB scales\n\n## Demo\nCheck out the [live demo](https://mattfors.github.io/ng-scales/)\n\n\n## Get started\n### Installing\nAdd the `npm` package to your app\n```shell\nnpm i ng-scales\n```\n\n### Using in angular application\nAdd the providers in the `app.config.ts`\n```typescript\nproviders: [\n  ...\n  provideNgScales()\n  ...\n]\n```\n\nThe easiest way to integrate is the provided button directive which handles connecting and disconnecting from the scale. Add this into your template\n\n```html\n\u003cbutton libNgScalesConnectionButton\u003e\u003c/button\u003e\n```\n\nImport the component\n```typescript\n@Component({\n  ...\n  imports: [NgScalesConnectionButtonDirective]\n  ...\n})\n```\n\n## Hardware Support\n\n### Built in support\n| Vendor | Vendor ID | Product | Product Id |                 Name                  | Verified |\n|:------:|:----------|:-------:|:-----------|:-------------------------------------:|:--------:|\n|  DYMO  | 2338     |   M25   | 32771      |  DYMO M25 25 Lb Digital Postal Scale  |    ✅     |\n\n### Adding support for additional scales\nYou can add a new scale by providing additional mappers. The mapper function coverts the array buffer into a usable data object\n\n```typescript\n  provideNgScales({mappers: [\n    {\n      vendorId: 2338,\n      productId: 32771,\n      mapper: (arrayBuffer: ArrayBuffer): HardwareScaleReportEvent =\u003e {\n        const d = new Uint8Array(arrayBuffer);\n        let weight = (d[3] + 256 * d[4])/10;\n        if (d[0] === 5) {\n          weight *= -1;\n        }\n        return {\n          units: d[1] === 2 ? 'grams' : 'ounces',\n          weight\n        };\n      }\n    }\n  ]})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattfors%2Fng-scales","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattfors%2Fng-scales","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattfors%2Fng-scales/lists"}