Skip to content

Commit 5628dc8

Browse files
committedDec 19, 2023
Require Node.js 18
1 parent ba6e43b commit 5628dc8

File tree

6 files changed

+192
-594
lines changed

6 files changed

+192
-594
lines changed
 

‎.github/funding.yml

-4
This file was deleted.

‎.github/workflows/main.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@ jobs:
1212
node-version:
1313
- 20
1414
- 18
15-
- 16
16-
- 14
1715
steps:
18-
- uses: actions/checkout@v3
19-
- uses: actions/setup-node@v3
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-node@v4
2018
with:
2119
node-version: ${{ matrix.node-version }}
2220
- run: npm install

‎index.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import {Buffer} from 'node:buffer';
33
import path from 'node:path';
44
import {fileURLToPath} from 'node:url';
55
import childProcess from 'node:child_process';
6-
import fs from 'node:fs/promises';
7-
import {constants as fsConstants} from 'node:fs'; // TODO: Move this to the above import when targeting Node.js 18.
6+
import fs, {constants as fsConstants} from 'node:fs/promises';
87
import isWsl from 'is-wsl';
98
import defineLazyProperty from 'define-lazy-prop';
109
import defaultBrowser from 'default-browser';
@@ -202,7 +201,7 @@ const baseOpen = async options => {
202201
}
203202

204203
if (appArguments.length > 0) {
205-
appArguments = appArguments.map(arg => `"\`"${arg}\`""`);
204+
appArguments = appArguments.map(argument => `"\`"${argument}\`""`);
206205
encodedArguments.push('-ArgumentList', appArguments.join(','));
207206
}
208207

‎package.json

+8-7
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
"types": "./index.d.ts",
1616
"default": "./index.js"
1717
},
18+
"sideEffects": false,
1819
"engines": {
19-
"node": ">=14.16"
20+
"node": ">=18"
2021
},
2122
"scripts": {
2223
"test": "xo && tsd"
@@ -53,15 +54,15 @@
5354
"file"
5455
],
5556
"dependencies": {
56-
"default-browser": "^4.0.0",
57+
"default-browser": "^5.2.0",
5758
"define-lazy-prop": "^3.0.0",
5859
"is-inside-container": "^1.0.0",
59-
"is-wsl": "^2.2.0"
60+
"is-wsl": "^3.1.0"
6061
},
6162
"devDependencies": {
62-
"@types/node": "^18.15.10",
63-
"ava": "^5.2.0",
64-
"tsd": "^0.28.0",
65-
"xo": "^0.54.2"
63+
"@types/node": "^20.10.5",
64+
"ava": "^6.0.1",
65+
"tsd": "^0.30.0",
66+
"xo": "^0.56.0"
6667
}
6768
}

‎test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ test('open URL in specified app', async t => {
2828

2929
test('open URL in specified app with arguments', async t => {
3030
await t.notThrowsAsync(async () => {
31-
const proc = await open('https://sindresorhus.com', {app: {name: apps.chrome, arguments: ['--incognito']}});
32-
t.deepEqual(proc.spawnargs, ['open', '-a', apps.chrome, 'https://sindresorhus.com', '--args', '--incognito']);
31+
const process_ = await open('https://sindresorhus.com', {app: {name: apps.chrome, arguments: ['--incognito']}});
32+
t.deepEqual(process_.spawnargs, ['open', '-a', apps.chrome, 'https://sindresorhus.com', '--args', '--incognito']);
3333
});
3434
});
3535

0 commit comments

Comments
 (0)