Skip to content

Commit

Permalink
Require Node.js 18
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Dec 19, 2023
1 parent ba6e43b commit 5628dc8
Show file tree
Hide file tree
Showing 6 changed files with 192 additions and 594 deletions.
4 changes: 0 additions & 4 deletions .github/funding.yml

This file was deleted.

6 changes: 2 additions & 4 deletions .github/workflows/main.yml
Expand Up @@ -12,11 +12,9 @@ jobs:
node-version:
- 20
- 18
- 16
- 14
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install
Expand Down
5 changes: 2 additions & 3 deletions index.js
Expand Up @@ -3,8 +3,7 @@ import {Buffer} from 'node:buffer';
import path from 'node:path';
import {fileURLToPath} from 'node:url';
import childProcess from 'node:child_process';
import fs from 'node:fs/promises';
import {constants as fsConstants} from 'node:fs'; // TODO: Move this to the above import when targeting Node.js 18.
import fs, {constants as fsConstants} from 'node:fs/promises';
import isWsl from 'is-wsl';
import defineLazyProperty from 'define-lazy-prop';
import defaultBrowser from 'default-browser';
Expand Down Expand Up @@ -202,7 +201,7 @@ const baseOpen = async options => {
}

if (appArguments.length > 0) {
appArguments = appArguments.map(arg => `"\`"${arg}\`""`);
appArguments = appArguments.map(argument => `"\`"${argument}\`""`);
encodedArguments.push('-ArgumentList', appArguments.join(','));
}

Expand Down
15 changes: 8 additions & 7 deletions package.json
Expand Up @@ -15,8 +15,9 @@
"types": "./index.d.ts",
"default": "./index.js"
},
"sideEffects": false,
"engines": {
"node": ">=14.16"
"node": ">=18"
},
"scripts": {
"test": "xo && tsd"
Expand Down Expand Up @@ -53,15 +54,15 @@
"file"
],
"dependencies": {
"default-browser": "^4.0.0",
"default-browser": "^5.2.0",
"define-lazy-prop": "^3.0.0",
"is-inside-container": "^1.0.0",
"is-wsl": "^2.2.0"
"is-wsl": "^3.1.0"
},
"devDependencies": {
"@types/node": "^18.15.10",
"ava": "^5.2.0",
"tsd": "^0.28.0",
"xo": "^0.54.2"
"@types/node": "^20.10.5",
"ava": "^6.0.1",
"tsd": "^0.30.0",
"xo": "^0.56.0"
}
}
4 changes: 2 additions & 2 deletions test.js
Expand Up @@ -28,8 +28,8 @@ test('open URL in specified app', async t => {

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

Expand Down

0 comments on commit 5628dc8

Please sign in to comment.