How to use the @sindresorhus/do-not-disturb.toggle function in @sindresorhus/do-not-disturb

To help you get started, we’ve selected a few @sindresorhus/do-not-disturb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sindresorhus / do-not-disturb-cli / cli.js View on Github external
(async () => {
	switch (command) {
		case 'on':
			await doNotDisturb.enable();
			break;
		case 'off':
			await doNotDisturb.disable();
			break;
		case 'toggle':
			await doNotDisturb.toggle();
			break;
		case 'status':
			console.log(await doNotDisturb.isEnabled() ? 'on' : 'off');
			break;
		default:
			cli.showHelp();
	}
})();
github sindresorhus / do-not-disturb-cli / dnd.js View on Github external
#!/usr/bin/env node
'use strict';
const meow = require('meow');
const doNotDisturb = require('@sindresorhus/do-not-disturb');

meow(`
	Usage
	  $ dnd

	Toggle "Do Not Disturb"
`);

doNotDisturb.toggle();

@sindresorhus/do-not-disturb

Control the macOS `Do Not Disturb` feature

MIT
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis