diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c1870cf..441975c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,12 +10,10 @@ jobs: fail-fast: false matrix: node-version: - - 14 - - 12 - - 10 + - 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 diff --git a/cli.js b/cli.js index 3dc1f3d..fd8b658 100755 --- a/cli.js +++ b/cli.js @@ -1,18 +1,20 @@ #!/usr/bin/env node -'use strict'; -const meow = require('meow'); -const got = require('got'); +import process from 'node:process'; +import meow from 'meow'; +import got from 'got'; meow(` Usage $ is-github-down 🦄 It's down. Play with your 😸/🐶! And stay home! -`); +`, { + importMeta: import.meta, +}); (async () => { const {status} = await got('https://kctbh9vrtdwd.statuspage.io/api/v2/summary.json', { - timeout: 10000, - retry: 2 + timeout: 10_000, + retry: 2, }).json(); if (['major', 'critical'].includes(status.indicator)) { diff --git a/package.json b/package.json index 6531488..67e5e71 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,10 @@ "email": "sindresorhus@gmail.com", "url": "https://sindresorhus.com" }, - "bin": "cli.js", + "type": "module", + "bin": "./cli.js", "engines": { - "node": ">=10" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "scripts": { "test": "xo && ava" @@ -30,12 +31,12 @@ "status" ], "dependencies": { - "got": "^11.0.1", - "meow": "^6.1.0" + "got": "^11.8.2", + "meow": "^10.1.1" }, "devDependencies": { - "ava": "^2.4.0", - "execa": "^4.0.0", - "xo": "^0.29.1" + "ava": "^3.15.0", + "execa": "^5.1.1", + "xo": "^0.45.0" } } diff --git a/readme.md b/readme.md index 857ef2e..9c8493e 100644 --- a/readme.md +++ b/readme.md @@ -4,14 +4,14 @@ ## Quick usage -``` -$ npx is-github-down +```sh +npx is-github-down ``` ## Install -``` -$ npm install --global is-github-down +```sh +npm install --global is-github-down ``` ## Usage