dm

dark-mode

Control the macOS dark mode

Showing:

Popularity

Downloads/wk

35

GitHub Stars

108

Maintenance

Last Commit

9mos ago

Contributors

1

Package

Dependencies

1

Size (min+gzip)

14.2KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

node-dark-mode

Control the macOS dark mode

Requires macOS 10.10 or later.

Install

$ npm install --save 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.

License

MIT © Sindre Sorhus

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial