Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/modules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ ESLint plugin.
- [`ora`](./ora.md)
- [`path-exists`](./path-exists.md)
- [`portal-vue`](./portal-vue.md)
- [`portfinder`](./portfinder.md)
- [`pkg-dir`](./pkg-dir.md)
- [`qs`](./qs.md)
- [`react-helmet`](./react-helmet.md)
Expand Down
19 changes: 19 additions & 0 deletions docs/modules/portfinder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
description: Modern alternatives to the portfinder package for finding an available port
---

# Replacements for `portfinder`

## `get-port`

[`get-port`](https://github.com/lukeed/get-port) provides a more generic way to find files and directories upwards.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[`get-port`](https://github.com/lukeed/get-port) provides a more generic way to find files and directories upwards.
[`get-port`](https://github.com/lukeed/get-port) provides a more straight forward and modern way to find an available port.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[`get-port`](https://github.com/lukeed/get-port) provides a more generic way to find files and directories upwards.
[`get-port`](https://github.com/sindresorhus/get-port) is a lighter and more modern package for finding an available port.

the url was wrong too, but also reworded it again


Example:

```ts
import portfinder from 'portfinder' // [!code --]
import getPort from 'get-port' // [!code ++]

const port = await portfinder.getPortPromise() // [!code --]
const port = await getPort() // [!code ++]
```
12 changes: 12 additions & 0 deletions manifests/preferred.json
Original file line number Diff line number Diff line change
Expand Up @@ -2448,6 +2448,12 @@
"replacements": ["Teleport"],
"url": {"type": "e18e", "id": "portal-vue"}
},
"portfinder": {
"type": "module",
"moduleName": "portfinder",
"replacements": ["get-port"],
"url": {"type": "e18e", "id": "portfinder"}
},
"preferred-pm": {
"type": "module",
"moduleName": "preferred-pm",
Expand Down Expand Up @@ -3068,6 +3074,12 @@
},
"url": {"type": "node", "id": "api/fs.html#fspromisesrmdirpath-options"}
},
"get-port": {
"id": "get-port",
"type": "documented",
"url": {"type": "e18e", "id": "portfinder"},
"replacementModule": "get-port"
},
"grammy": {
"id": "grammy",
"type": "documented",
Expand Down