Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(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();
}
})();
#!/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();