indutny / indutny/node-ip

No need for regex to check for loopback anymore

Open
#32 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.5k
Forks
228
PR merge metrics
No merged PRs in 30d

Description

The newer versions of node (see [here](https://nodejs.org/api/os.html#os_os_networkinterfaces)) provide a new property called `internal` which can be used to detect internal addresses (i.e. loopback), so I would say `isLoopback` can be replaced with `details.internal`.

I know this might be minimal improvement, but I think its the first step in upgrading to the new `os` API.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating isLoopback and reviewing how network interface details are handled. Confirm the supported Node.js versions and compare the existing loopback check with details.internal from the os.networkInterfaces API. Done means the regex-based check is replaced where appropriate and the existing tests still pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
networking
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.