Skip to content

Commit

Permalink
Require Node.js 16
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Jun 4, 2023
1 parent bd8a403 commit 5cc3422
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 26 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {ListenOptions} from 'node:net';
import {type ListenOptions} from 'node:net';

export interface Options extends Omit<ListenOptions, 'port'> {
export type Options = {
/**
A preferred port or an iterable of preferred ports to use.
*/
Expand All @@ -19,7 +19,7 @@ export interface Options extends Omit<ListenOptions, 'port'> {
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<ListenOptions, 'port'>;

/**
Get an available TCP port number.
Expand Down
16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
}
12 changes: 0 additions & 12 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

---

<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-get-port?utm_source=npm-get-port&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>

0 comments on commit 5cc3422

Please sign in to comment.