From b9779826cd5146bc6bdb8d74f63a304deff80158 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Wed, 20 Jul 2022 01:13:17 +0200 Subject: [PATCH] Require Node.js 14 --- .github/workflows/main.yml | 6 +++--- cli.js | 18 ++++++++---------- package.json | 12 ++++++------ readme.md | 4 ++-- test.js | 2 +- 5 files changed, 20 insertions(+), 22 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3b8aa86..d50ada6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,12 +10,12 @@ jobs: fail-fast: false matrix: node-version: + - 18 - 16 - 14 - - 12 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - run: npm install diff --git a/cli.js b/cli.js index d100627..cf7059d 100755 --- a/cli.js +++ b/cli.js @@ -1,6 +1,7 @@ #!/usr/bin/env node +import process from 'node:process'; import meow from 'meow'; -import del from 'del'; +import {deleteAsync} from 'del'; const cli = meow(` Usage @@ -27,16 +28,13 @@ const cli = meow(` }, }); -(async () => { - if (cli.input.length === 0) { - console.error('Specify at least one path'); - process.exitCode = 1; - return; - } - - const files = await del(cli.input, cli.flags); +if (cli.input.length === 0) { + console.error('Specify at least one path'); + process.exitCode = 1; +} else { + const files = await deleteAsync(cli.input, cli.flags); if (cli.flags.dryRun) { console.log(files.join('\n')); } -})(); +} diff --git a/package.json b/package.json index f9d99e6..420e926 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "del-cli": "./cli.js" }, "engines": { - "node": ">=12.20" + "node": ">=14.16" }, "scripts": { "test": "xo && ava" @@ -50,13 +50,13 @@ "cross-platform" ], "dependencies": { - "del": "^6.0.0", - "meow": "^10.1.0" + "del": "^7.0.0", + "meow": "^10.1.3" }, "devDependencies": { - "ava": "^3.15.0", - "execa": "^5.1.1", + "ava": "^4.3.1", + "execa": "^6.1.0", "temp-write": "^5.0.0", - "xo": "^0.41.0" + "xo": "^0.50.0" } } diff --git a/readme.md b/readme.md index 2b2b161..edd6aee 100644 --- a/readme.md +++ b/readme.md @@ -8,8 +8,8 @@ Useful for use in build scripts and automated things. ## Install -``` -$ npm install --global del-cli +```sh +npm install --global del-cli ``` ## Usage diff --git a/test.js b/test.js index a0d1a1c..9266673 100644 --- a/test.js +++ b/test.js @@ -1,7 +1,7 @@ import fs from 'node:fs'; import test from 'ava'; import tempWrite from 'temp-write'; -import execa from 'execa'; +import {execa} from 'execa'; test('main', async t => { const filename = tempWrite.sync('foo');