{"id":15664764,"url":"https://github.com/linusu/node-dark-mode-listener","last_synced_at":"2025-08-05T18:06:06.674Z","repository":{"id":65991997,"uuid":"158533912","full_name":"LinusU/node-dark-mode-listener","owner":"LinusU","description":"A small library for listening to dark mode changes on macOS Mojave","archived":false,"fork":false,"pushed_at":"2022-11-18T12:42:07.000Z","size":3113,"stargazers_count":17,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T02:11:51.350Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/LinusU.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}},"created_at":"2018-11-21T10:54:08.000Z","updated_at":"2024-08-27T13:42:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"2ec48003-6467-47d0-a65a-dca346c70c3e","html_url":"https://github.com/LinusU/node-dark-mode-listener","commit_stats":{"total_commits":12,"total_committers":1,"mean_commits":12.0,"dds":0.0,"last_synced_commit":"3f807c0b318e4535656ab28275cb9d9c11d597fe"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Fnode-dark-mode-listener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Fnode-dark-mode-listener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Fnode-dark-mode-listener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Fnode-dark-mode-listener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LinusU","download_url":"https://codeload.github.com/LinusU/node-dark-mode-listener/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252752755,"owners_count":21798846,"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-03T13:44:06.403Z","updated_at":"2025-05-06T19:29:24.129Z","avatar_url":"https://github.com/LinusU.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node.js Dark Mode Listener\n\nA small library for listening to dark mode changes on macOS Mojave.\n\n## Installation\n\n```sh\nnpm install --save dark-mode-listener\n```\n\n## Usage\n\n```js\nconst DarkMode = require('dark-mode-listener')\n\nDarkMode.on('change', (value) =\u003e {\n  console.log(`We are now in ${value} mode`)\n  //=\u003e We are now in dark mode\n})\n```\n\nThe export of the module is an `EventEmitter` that will emit a `change` event whenever dark mode is toggled on or off, and initially when the module is loaded.\n\n## API\n\n### event: `change`\n\nThe `change` event is emitted whenever dark mode is toggled on or off, and initially when the module is loaded. The value is a single string that will read either `'light'` or `'dark'`.\n\n### `.currentValue`\n\nHolds the current value, either `'light'` or `'dark'`. This property will be `undefined` until the first `change` event have been emitted.\n\n### `.stop()`\n\nStop listening for changes.\n\n## Implementation\n\nThis package ships with a small binary, [dark-mode-listener](https://github.com/LinusU/DarkModeListener), to listen to the changes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinusu%2Fnode-dark-mode-listener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinusu%2Fnode-dark-mode-listener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinusu%2Fnode-dark-mode-listener/lists"}