{"id":41092265,"url":"https://github.com/stamp/beckhoff-js","last_synced_at":"2026-01-22T14:51:37.774Z","repository":{"id":143854142,"uuid":"221569404","full_name":"stamp/beckhoff-js","owner":"stamp","description":"A promise based client implementation of the TwinCAT AMS and ADS protocols from Beckhoff.","archived":false,"fork":false,"pushed_at":"2020-07-29T21:04:26.000Z","size":149,"stargazers_count":12,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-20T03:06:06.677Z","etag":null,"topics":["beckhoff","plc","twincat-ads","typescript-library"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stamp.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":"2019-11-13T23:14:31.000Z","updated_at":"2025-09-17T01:30:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"fc36a98b-1189-4aeb-b561-f851cf32a946","html_url":"https://github.com/stamp/beckhoff-js","commit_stats":{"total_commits":31,"total_committers":2,"mean_commits":15.5,"dds":0.3548387096774194,"last_synced_commit":"3d9f56b4313477e8e35371cf6c8ee31d7667c6bb"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/stamp/beckhoff-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stamp%2Fbeckhoff-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stamp%2Fbeckhoff-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stamp%2Fbeckhoff-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stamp%2Fbeckhoff-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stamp","download_url":"https://codeload.github.com/stamp/beckhoff-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stamp%2Fbeckhoff-js/sbom","scorecard":{"id":845890,"data":{"date":"2025-08-11","repo":{"name":"github.com/stamp/beckhoff-js","commit":"3d9f56b4313477e8e35371cf6c8ee31d7667c6bb"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":2,"reason":"Found 2/9 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/stamp/beckhoff-js/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/stamp/beckhoff-js/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/stamp/beckhoff-js/main.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/main.yml:18","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 24 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T21:26:00.610Z","repository_id":143854142,"created_at":"2025-08-23T21:26:00.610Z","updated_at":"2025-08-23T21:26:00.610Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28664715,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T14:01:31.714Z","status":"ssl_error","status_checked_at":"2026-01-22T13:59:23.143Z","response_time":144,"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":["beckhoff","plc","twincat-ads","typescript-library"],"created_at":"2026-01-22T14:51:37.609Z","updated_at":"2026-01-22T14:51:37.766Z","avatar_url":"https://github.com/stamp.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM version](https://img.shields.io/npm/v/beckhoff-js?style=for-the-badge)](https://www.npmjs.com/package/beckhoff-js)\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg?style=for-the-badge)](https://www.gnu.org/licenses/gpl-3.0)\n\n# beckhoff-js\n\n\u003e This is a Promise based client implementation of the Twincat ADS protocol from Beckhoff written in TypeScript.\n\n## API\n\n### Connection options\n\n```typescript\ninterface ConnectOptions {\n  source: {\n    netID: string;\n    amsPort?: number;\n  },\n  target: {\n    host: string;\n    port?: number;\n    netID?: string;\n    amsPort: number;\n  },\n  loadSymbols: boolean;\n  loadDataTypes: boolean;\n  reconnect: boolean;\n  reconnectInterval: number;\n}\n```\n\n### Connect to a PLC and read a tag\n\n```javascript\nconst AdsClient = require('beckhoff-js');\n\nconst options = {\n  target: {\n    host: \"172.16.21.6\",\n    netID: \"5.9.36.191.1.1\",\n    amsPort: 801\n  }\n};\n\nconst client = new AdsClient.default(options);\nclient\n  .connect()\n  .then(async () =\u003e {\n    // Read a tag\n    const bTest = await client.readTag(\".bTest\");\n    console.log('bTest value is', bTest);\n  });\n```\n\n### Connect to a PLC and write a tag\n\n```javascript\nconst AdsClient = require('beckhoff-js');\nconst options = {\n  target: {\n    host: \"172.16.21.6\",\n    netID: \"5.9.36.191.1.1\",\n    amsPort: 801\n  }\n};\nconst client = new AdsClient.default(options);\nclient\n  .connect()\n  .then(async () =\u003e {\n    // write a tag\n    return client.writeTag(\".bTest\", false);\n  })\n  .catch(err =\u003e {\n    console.log(\"failed to write: \", err);\n  });\n```\n\n### Connect to a PLC and monitor a tag\n\n```javascript\nconst AdsClient = require('beckhoff-js');\nconst options = {\n  target: {\n    host: \"172.16.21.6\",\n    netID: \"5.9.36.191.1.1\",\n    amsPort: 801\n  }\n};\nconst client = new AdsClient.default(options);\nclient\n  .connect()\n  .then(async () =\u003e {\n    // write a tag\n    return client.montorTag(\".bTest\",  (value, timestamp) =\u003e {\n      console.log(`.bTest value changed ${value} at ${timestamp}`)\n    });\n  })\n  .catch(err =\u003e {\n    console.log(\"failed monitor item: \", err);\n  });\n```\n\n### Events\n\nClient extends `EventEmtter` and emits following events:\n\n- `error` Errors. All methods are rejected if they end up with error. Here we have all other errors like connection errors\n- `connected` Connection established (or reconnection)\n- `reconnect` Reconnection started\n- `close` Connection closed\n\n### Symbols and tags\n\nThe library will automaticly load symbols and tags from the PLC. It will also keep track of sub items of a symbol for you.\n\nAll of the following `writeTag` calls are valid where `.Alvalyckan` is the symbol and the rest of the path is just sub items. The same is true for all of the `Tag` functions.\n\n```javascript\nawait client.writeTag(\".Alvalyckan.HotWaterCount\", 3)\nawait client.writeTag(\".Alvalyckan.Alarms.IBJFB_UTOMHUS\", false)\nawait client\n  .writeTag(\".Alvalyckan.Alarms\", {\n    IBJFB_KYL: true,\n    IBJFB_FRYS: false,\n    IBJFB_UTOMHUS: true\n  });\n```\n\n### Arrays and tags\n\nThis library supports `Arrays`. ST Arrays may have different starting point, Nodejs Arrays startng point is allways 0.\nIf Array starting point is different, all members before that are `undefined` (`\u003cempty item\u003e`).\nMulti dimensional arrays are supported. MultiArray is not supported yet.\neg.\n\n```javascript\n //  arrAlarm: ARRAY [1 .. 2] OF BOOL;\n await client.readTag(\".arrAlarm\") // [ \u003c1 empty item\u003e, true, true ]\n```\n\nIf writing whole array, whole array needs to supplied.\n\n```javascript\n //  arrAlarm: ARRAY [1 .. 2] OF BOOL;\n await client.writeTag(\".arrAlarm\". [undefined, false, false])\n```\n\nYou can use array indexes for read, write and monitor:\n\n```javascript\n //  arrAlarm: ARRAY [1 .. 2] OF BOOL;\n await client.readTag(\".arrAlarm[1]\") // true\n```\n\n## Credits, sources and inspiration\n\nThere is a lot of projects and information on Beckhoff ADS out there! Below you'll find the ones that has been my primary inspiration and source of information.\n\n* https://github.com/src-one/twincat-ads\n* https://github.com/tomcx/tame4\n* https://github.com/stlehmann/pyads\n* https://github.com/Beckhoff/ADS\n* https://github.com/DEMCON/python-ads\n* https://github.com/roccomuso/node-ads\n* https://github.com/dkleber89/ioBroker.beckhoff\n* https://infosys.beckhoff.com/content/1033/tcadsamsspec/html/tcadsamsspec_amstcppackage.htm?id=2322770954845974327\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstamp%2Fbeckhoff-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstamp%2Fbeckhoff-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstamp%2Fbeckhoff-js/lists"}