From 5cc3422290fff3f9f08beed2d9a2eb1eed0928b4 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Sun, 4 Jun 2023 15:48:39 +0300 Subject: [PATCH] Require Node.js 16 --- .github/workflows/main.yml | 8 ++++---- index.d.ts | 6 +++--- package.json | 16 +++++++++------- readme.md | 12 ------------ 4 files changed, 16 insertions(+), 26 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0a3c435..afef87e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,12 +14,12 @@ jobs: - windows-latest - macos-latest node-version: + - 20 + - 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/index.d.ts b/index.d.ts index 9f327b9..765eb6c 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,6 +1,6 @@ -import {ListenOptions} from 'node:net'; +import {type ListenOptions} from 'node:net'; -export interface Options extends Omit { +export type Options = { /** A preferred port or an iterable of preferred ports to use. */ @@ -19,7 +19,7 @@ export interface Options extends Omit { By default, it checks availability on all local addresses defined in [OS network interfaces](https://nodejs.org/api/os.html#os_os_networkinterfaces). If this option is set, it will only check the given host. */ readonly host?: string; -} +} & Omit; /** Get an available TCP port number. diff --git a/package.json b/package.json index 455ed40..a6dd17e 100644 --- a/package.json +++ b/package.json @@ -11,9 +11,12 @@ "url": "https://sindresorhus.com" }, "type": "module", - "exports": "./index.js", + "exports": { + "types": "./index.d.ts", + "default": "./index.js" + }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=16" }, "scripts": { "test": "xo && ava && tsd" @@ -40,11 +43,10 @@ "chosen" ], "devDependencies": { - "@types/node": "^16.10.2", - "ava": "^3.15.0", - "tsd": "^0.17.0", - "typescript": "^4.4.3", - "xo": "^0.45.0" + "@types/node": "^20.2.5", + "ava": "^5.3.0", + "tsd": "^0.28.1", + "xo": "^0.54.2" }, "sideEffects": false } diff --git a/readme.md b/readme.md index b6cd616..7693df4 100644 --- a/readme.md +++ b/readme.md @@ -103,15 +103,3 @@ Race conditions in the same process are mitigated against by using a lightweight ## Related - [get-port-cli](https://github.com/sindresorhus/get-port-cli) - CLI for this module - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-