dark-mode

4.0.0 • Public • Published

node-dark-mode

Control the macOS dark mode

Requires macOS 10.10 or later.

Install

npm install dark-mode

Usage

import darkMode from 'dark-mode';

await darkMode.enable();
console.log('Enabled dark mode');

await darkMode.toggle();
console.log('Toggled between dark and light mode');

API

darkMode

All the methods return a Promise.

.enable()

.disable()

.toggle(force?)

force

Type: boolean

Force a specific mode. true for dark and false for light.

.isEnabled()

Returns a Promise<boolean> of whether you're in dark mode.

Related

Package Sidebar

Install

npm i dark-mode

Weekly Downloads

41

Version

4.0.0

License

MIT

Unpacked Size

3.33 kB

Total Files

4

Last publish

Collaborators

  • sindresorhus