Skip to content

Commit

Permalink
Require Node.js 12.20
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Oct 14, 2021
1 parent 22f314e commit 9e1c018
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 39 deletions.
3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
* text=auto
*.js text eol=lf
* text=auto eol=lf
3 changes: 0 additions & 3 deletions .github/funding.yml

This file was deleted.

7 changes: 2 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,10 @@ jobs:
fail-fast: false
matrix:
node-version:
- 14
- 12
- 10
- 8
- 16
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm install
Expand Down
9 changes: 5 additions & 4 deletions cli.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env node
'use strict';
const meow = require('meow');
const doNotDisturb = require('@sindresorhus/do-not-disturb');
import meow from 'meow';
import doNotDisturb from '@sindresorhus/do-not-disturb';

const cli = meow(`
Usage
Expand All @@ -19,7 +18,9 @@ const cli = meow(`
on
Use \`$ dnd\` to quickly toggle
`);
`, {
importMeta: import.meta,
});

const [command] = cli.input;

Expand Down
9 changes: 5 additions & 4 deletions dnd.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/usr/bin/env node
'use strict';
const meow = require('meow');
const doNotDisturb = require('@sindresorhus/do-not-disturb');
import meow from 'meow';
import doNotDisturb from '@sindresorhus/do-not-disturb';

meow(`
Usage
$ dnd
Toggle "Do Not Disturb"
`);
`, {
importMeta: import.meta,
});

doNotDisturb.toggle();
2 changes: 1 addition & 1 deletion license
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) Sindre Sorhus <[email protected]> (sindresorhus.com)
Copyright (c) Sindre Sorhus <[email protected]> (https://sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
20 changes: 11 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@
"description": "Control the macOS `Do Not Disturb` feature from the command-line",
"license": "MIT",
"repository": "sindresorhus/do-not-disturb-cli",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "[email protected]",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},
"type": "module",
"bin": {
"do-not-disturb": "cli.js",
"dnd": "dnd.js"
"do-not-disturb": "./cli.js",
"dnd": "./dnd.js"
},
"engines": {
"node": ">=8"
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"scripts": {
"test": "xo && ava"
Expand All @@ -31,12 +33,12 @@
"notifications"
],
"dependencies": {
"@sindresorhus/do-not-disturb": "^0.2.0",
"meow": "^4.0.0"
"@sindresorhus/do-not-disturb": "^2.0.0",
"meow": "^10.1.1"
},
"devDependencies": {
"ava": "*",
"execa": "^0.9.0",
"xo": "*"
"ava": "^3.15.0",
"execa": "^5.1.1",
"xo": "^0.45.0"
}
}
12 changes: 2 additions & 10 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

> Control the macOS `Do Not Disturb` feature from the command-line

## Install

```
$ npm install --global do-not-disturb-cli
```sh
npm install --global do-not-disturb-cli
```


## Usage

```
Expand All @@ -32,12 +30,6 @@ $ do-not-disturb --help
Use `$ dnd` to quickly toggle
```


## Related

- [do-not-disturb](https://github.com/sindresorhus/do-not-disturb) - API for this module


## License

MIT © [Sindre Sorhus](https://sindresorhus.com)
3 changes: 2 additions & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ import test from 'ava';
import execa from 'execa';

test('main', async t => {
t.regex(await execa.stdout('./cli.js', ['status']), /on|off/);
const {stdout} = await execa('./cli.js', ['status']);
t.regex(stdout, /on|off/);
});

0 comments on commit 9e1c018

Please sign in to comment.