{"id":18799897,"url":"https://github.com/mcnaveen/is-darkmode","last_synced_at":"2025-09-06T04:36:42.586Z","repository":{"id":57277108,"uuid":"520011468","full_name":"mcnaveen/is-darkmode","owner":"mcnaveen","description":"🦄 A Simple utility to find whether darkmode is enabled.","archived":false,"fork":false,"pushed_at":"2022-08-01T16:38:28.000Z","size":704,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-21T20:11:16.309Z","etag":null,"topics":["color-scheme","darkmode","display-theme","is-darkmode","is-lightmode","lightmode"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/is-darkmode","language":"JavaScript","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/mcnaveen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":"mcnaveen","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://www.buymeacoffee.com/mcnaveen"}},"created_at":"2022-08-01T07:39:24.000Z","updated_at":"2023-09-08T08:23:36.000Z","dependencies_parsed_at":"2022-09-03T09:21:29.645Z","dependency_job_id":null,"html_url":"https://github.com/mcnaveen/is-darkmode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mcnaveen/is-darkmode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcnaveen%2Fis-darkmode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcnaveen%2Fis-darkmode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcnaveen%2Fis-darkmode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcnaveen%2Fis-darkmode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mcnaveen","download_url":"https://codeload.github.com/mcnaveen/is-darkmode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcnaveen%2Fis-darkmode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273858845,"owners_count":25180766,"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","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"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":["color-scheme","darkmode","display-theme","is-darkmode","is-lightmode","lightmode"],"created_at":"2024-11-07T22:17:00.578Z","updated_at":"2025-09-06T04:36:42.556Z","avatar_url":"https://github.com/mcnaveen.png","language":"JavaScript","funding_links":["https://patreon.com/mcnaveen","https://www.buymeacoffee.com/mcnaveen"],"categories":[],"sub_categories":[],"readme":"# :waxing_crescent_moon: Is Darkmode?\n\n![Downloads this Week](https://img.shields.io/npm/dw/is-darkmode)\n![Bundle Size](https://img.shields.io/bundlephobia/min/is-darkmode)\n![Version](https://img.shields.io/npm/v/is-darkmode)\n\n![is-darkmode](./image/cover.png)\n\n:unicorn: A Simple utility to find whether darkmode is enabled.\n\n### :package: Requirements\n\nNode.js 16.x LTS\n\n### :sparkles: Installation\n\nInstall the NPM Package with the below command:\n\n```\nnpm install is-darkmode --save\n```\n\n(or)\n\nInstall with Yarn:\n\n```\nyarn add is-darkmode\n```\n\n### :pen: Usage\n\nImport the module in your project:\n\n```javascript\n// Commonjs Import\nvar { isDarkmode } = require(\"is-darkmode\");\n\n// or ES6 import\nimport { isDarkmode } from \"is-darkmode\";\n```\n\n### :bulb: Example\n\nInside your React app, Pass the function into a Variable.\n\nWith that you can conditionally render the content based on the result of the function.\n\n```jsx\nimport { isDarkmode } from \"is-darkmode\";\n\nexport default function App() {\n  const checkDarkmode = isDarkmode();\n\n  return (\n    \u003cdiv className=\"App\"\u003e\n      \u003ch1\u003eHello App\u003c/h1\u003e\n      \u003cp\u003e{checkDarkmode ? \"Darkmode is Enabled\" : \"Darkmode is Disabled\"}\u003c/p\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\n### :ballot_box_with_check: Example Output\n\n![Example Output](./image/preview.png)\n\n---\n\n#### :green_heart: Message\n\nI hope you find this useful. If you have any questions, please create an issue.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcnaveen%2Fis-darkmode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcnaveen%2Fis-darkmode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcnaveen%2Fis-darkmode/lists"}