{"id":15464440,"url":"https://github.com/dabolus/webos-tv","last_synced_at":"2025-04-28T12:21:09.779Z","repository":{"id":63974924,"uuid":"153937967","full_name":"Dabolus/webos-tv","owner":"Dabolus","description":"A promise-based package to control LGTVs with JavaScript.","archived":false,"fork":false,"pushed_at":"2023-10-29T15:10:25.000Z","size":3303,"stargazers_count":6,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T09:31:32.227Z","etag":null,"topics":["async","javascript","lgtv","promise","typescript","webos","webos-tv"],"latest_commit_sha":null,"homepage":"https://dabolus.github.io/webos-tv","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/Dabolus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","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":"2018-10-20T18:54:04.000Z","updated_at":"2024-08-20T03:45:26.000Z","dependencies_parsed_at":"2024-10-22T00:11:49.018Z","dependency_job_id":null,"html_url":"https://github.com/Dabolus/webos-tv","commit_stats":{"total_commits":162,"total_committers":2,"mean_commits":81.0,"dds":0.3641975308641975,"last_synced_commit":"7abb5c9cd0edf31279a39cecc4f41205888053ee"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dabolus%2Fwebos-tv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dabolus%2Fwebos-tv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dabolus%2Fwebos-tv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dabolus%2Fwebos-tv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dabolus","download_url":"https://codeload.github.com/Dabolus/webos-tv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251311340,"owners_count":21569011,"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":["async","javascript","lgtv","promise","typescript","webos","webos-tv"],"created_at":"2024-10-02T00:36:13.607Z","updated_at":"2025-04-28T12:21:09.760Z","avatar_url":"https://github.com/Dabolus.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# webOS TV\n\nA promise-based package to control webOS based TVs with JavaScript.\n\n## Installation\n\n```bash\nnpm install webos-tv\n# or\nyarn add webos-tv\n```\n\nIf you want to use the library in a Node.js environment, make\nsure to install also the optional peer dependencies:\n\n```bash\nnpm install ws\n# or\nyarn add ws\n# plus the optional native peer dependencies for ws,\n# if you want to improve performance\n# see: https://npmjs.com/package/ws#user-content-opt-in-for-performance\nnpm install --save-optional bufferutil utf-8-validate\n# or\nyarn add --optional bufferutil utf-8-validate\n```\n\nOn browser, the native Fetch and WebSocket APIs are used,\nso nothing else is needed.\n\n## Usage\n\n### Simple usage\n\n```js\nimport { TV } from 'webos-tv';\n\nconst ip = '\u003cyour TV IP address\u003e';\n\nconst tv = new TV(ip);\n// On first authentication, no token is required.\n// The `authenticate` function will return a token\n// once the pairing is accepted on the TV.\nconst token = await tv.authenticate();\n// The received token should be stored somewhere so\n// that it can be used in subsequent connections.\n// e.g. await tv.authenticate(token);\nconsole.log('Software information: ', await tv.getCurrentSWInformation());\nawait tv.showNotification('Hello, World!');\nawait tv.disconnect();\n```\n\n### Pointer and keyboard control\n\nThe TV class allows opening specialized input sockets that allow\nto have a dedicated channel to control the TV pointer and keyboard.\n\n```js\nimport { TV } from 'webos-tv';\n\nconst ip = '\u003cyour TV IP address\u003e';\n\nconst tv = new TV(ip);\nawait tv.authenticate();\n\n// This method will return a PointerInputSocket instance\nconst pointerSocket = await tv.getPointerInputSocket();\npointerSocket.move(20, 30);\npointerSocket.click();\npointerSocket.scroll(0, 10);\n```\n\n### Wake-on-LAN\n\nIf your TV supports Wake-on-LAN, you can use the `wake` function\nto turn it on:\n\n```js\nimport { TV } from 'webos-tv';\n\nconst ip = '\u003cyour TV IP address\u003e';\nconst mac = '\u003cyour TV MAC address\u003e';\nconst password = '\u003cyour TV SecureOn password, if required\u003e';\n\n// `turnOn` is a static method of the TV class, so it must be called\n// before setting up the connection to the TV (obviously).\nawait TV.turnOn(ip, mac, password);\n\n// If everything went well, the TV should be turned on now,\n// so you should be able to connect to it normally (see above).\n// Note that after being turned on, the TV might require some\n// seconds before being ready to accept WebSocket connections.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdabolus%2Fwebos-tv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdabolus%2Fwebos-tv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdabolus%2Fwebos-tv/lists"}