Control the macOS dark mode
Requires macOS 10.10 or later.
npm install dark-mode
import darkMode from 'dark-mode';
await darkMode.enable();
console.log('Enabled dark mode');
await darkMode.toggle();
console.log('Toggled between dark and light mode');
All the methods return a Promise
.
Type: boolean
Force a specific mode. true
for dark and false
for light.
Returns a Promise<boolean>
of whether you're in dark mode.
- dark-mode-cli - CLI for this module
- alfred-dark-mode - Alfred workflow