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 Sep 18, 2021
1 parent 038f84e commit 5c66dfa
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 34 deletions.
3 changes: 0 additions & 3 deletions .github/funding.yml

This file was deleted.

6 changes: 2 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 15 additions & 13 deletions cli.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
#!/usr/bin/env node
'use strict';
const meow = require('meow');
const logSymbols = require('log-symbols');
const isUp = require('is-up');
const prependHttp = require('prepend-http');
import process from 'node:process';
import meow from 'meow';
import logSymbols from 'log-symbols';
import isUp from 'is-up';
import prependHttp from 'prepend-http';

const cli = meow(`
Example
$ is-up sindresorhus.com
${logSymbols.success} Up
Exits with code 0 if up and 2 if down
`);
`, {
importMeta: import.meta,
});

if (cli.input.length === 0) {
console.error('Specify a URL');
process.exit(1);
process.exitCode = 1;
} else {
(async () => {
const up = await isUp(prependHttp(cli.input[0]));
console.log(up ? `${logSymbols.success} Up` : `${logSymbols.error} Down`);
process.exitCode = up ? 0 : 2;
})();
}

(async () => {
const up = await isUp(prependHttp(cli.input[0]));
console.log(up ? `${logSymbols.success} Up` : `${logSymbols.error} Down`);
process.exitCode = up ? 0 : 2;
})();
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 <sindresorhus@gmail.com> (sindresorhus.com)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (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
23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},
"type": "module",
"bin": {
"is-up": "cli.js"
"is-up": "./cli.js"
},
"engines": {
"node": ">=10"
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"scripts": {
"test": "xo && ava"
Expand All @@ -36,15 +37,15 @@
"offline"
],
"dependencies": {
"is-up": "^4.0.0",
"log-symbols": "^3.0.0",
"meow": "^6.0.0",
"prepend-http": "^3.0.1"
"is-up": "^5.0.0",
"log-symbols": "^5.0.0",
"meow": "^10.1.1",
"prepend-http": "^4.0.0"
},
"devDependencies": {
"ava": "^1.0.0",
"execa": "^4.0.0",
"strip-ansi": "^6.0.0",
"xo": "^0.25.4"
"ava": "^3.15.0",
"execa": "^5.1.1",
"strip-ansi": "^7.0.1",
"xo": "^0.44.0"
}
}
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

## Install

```
$ npm install --global is-up-cli
```sh
npm install --global is-up-cli
```

## Usage
Expand Down

0 comments on commit 5c66dfa

Please sign in to comment.