All Projects → sindresorhus → Node Dark Mode

sindresorhus / Node Dark Mode

Licence: mit
Control the macOS dark mode

Programming Languages

javascript
184084 projects - #8 most used programming language

node-dark-mode

Control the macOS dark mode

Requires macOS 10.10 or later.

Install

$ npm install dark-mode

Usage

const darkMode = require('dark-mode');

darkMode.enable().then(() => {
	console.log('Enabled dark mode');
});

darkMode.toggle().then(() => {
	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.

.isDark()

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

Related

License

MIT © Sindre Sorhus

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].