Skip to content

Commit

Permalink
Require Node.js 12
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Apr 16, 2021
1 parent b14a935 commit 6cd5680
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ jobs:
node-version:
- 14
- 12
- 10
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
11 changes: 5 additions & 6 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 supportsColor = require('supports-color');
import meow from 'meow';
import supportsColor from 'supports-color';

const cli = meow(`
Usage
Expand All @@ -19,7 +18,7 @@ const cli = meow(`
Exits with code 0 if color is supported and 1 if not
`);

const flags = cli.flags;
const level = flags['256'] ? 'has256' : flags['16m'] ? 'has16m' : 'hasBasic';
const {flags} = cli;
const level = flags['256'] ? 'has256' : (flags['16m'] ? 'has16m' : 'hasBasic');

process.exit(supportsColor[level] ? 0 : 1);
process.exitCode = supportsColor[level] ? 0 : 1;
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
"email": "[email protected]",
"url": "https://sindresorhus.com"
},
"type": "module",
"bin": {
"supports-color": "cli.js"
"supports-color": "./cli.js"
},
"engines": {
"node": ">=4"
"node": ">=12"
},
"scripts": {
"test": "xo && ava"
Expand Down Expand Up @@ -44,12 +45,12 @@
"detect"
],
"dependencies": {
"meow": "^3.7.0",
"supports-color": "^4.1.0"
"meow": "^9.0.0",
"supports-color": "^9.0.0"
},
"devDependencies": {
"ava": "^1",
"execa": "^0.7.0",
"xo": "^0.20.0"
"ava": "^3.15.0",
"execa": "^5.0.0",
"xo": "^0.38.2"
}
}

0 comments on commit 6cd5680

Please sign in to comment.