{"id":13527389,"url":"https://github.com/sindresorhus/internal-ip","last_synced_at":"2025-05-15T01:05:53.781Z","repository":{"id":20748506,"uuid":"24032963","full_name":"sindresorhus/internal-ip","owner":"sindresorhus","description":"Get your internal IP address","archived":false,"fork":false,"pushed_at":"2024-11-10T07:36:16.000Z","size":90,"stargazers_count":336,"open_issues_count":4,"forks_count":28,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-05-07T09:25:58.668Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sindresorhus.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/funding.yml","license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"sindresorhus","open_collective":"sindresorhus","buy_me_a_coffee":"sindresorhus","custom":"https://sindresorhus.com/donate"}},"created_at":"2014-09-14T20:43:27.000Z","updated_at":"2025-04-29T06:02:58.000Z","dependencies_parsed_at":"2024-11-26T14:42:39.656Z","dependency_job_id":null,"html_url":"https://github.com/sindresorhus/internal-ip","commit_stats":{"total_commits":66,"total_committers":10,"mean_commits":6.6,"dds":0.5,"last_synced_commit":"01503ae224deca9c4b2ad5a519e15f56c4e0439c"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Finternal-ip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Finternal-ip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Finternal-ip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Finternal-ip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sindresorhus","download_url":"https://codeload.github.com/sindresorhus/internal-ip/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254254039,"owners_count":22039792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T06:01:46.937Z","updated_at":"2025-05-15T01:05:53.756Z","avatar_url":"https://github.com/sindresorhus.png","language":"JavaScript","funding_links":["https://github.com/sponsors/sindresorhus","https://opencollective.com/sindresorhus","https://buymeacoffee.com/sindresorhus","https://sindresorhus.com/donate"],"categories":["Repository","JavaScript","Fingerprint","4. 工具"],"sub_categories":["Network","IP","4.2 系统相关"],"readme":"# internal-ip\n\n\u003e Get your internal IP address\n\n## Install\n\n```sh\nnpm install internal-ip\n```\n\n## Usage\n\n```js\nimport {internalIpV6, internalIpV4} from 'internal-ip';\n\nconsole.log(await internalIpV6());\n//=\u003e 'fe80::1'\n\nconsole.log(await internalIpV4());\n//=\u003e '10.0.0.79'\n```\n\n## API\n\nThe package returns the address of the internet-facing interface, as determined from the default gateway. When the address cannot be determined for any reason, `undefined` will be returned.\n\nThe package relies on operating systems tools. On Linux and Android, the `ip` command must be available, which depending on distribution might not be installed by default. It is usually provided by the `iproute2` package. `internalIpV6Sync()` and `internalIpV4Sync()` are not supported in browsers and just return `undefined`.\n\n### internalIpV6()\n\nReturns the internal IPv6 address asynchronously.\n\n### internalIpV4()\n\nReturns the internal IPv4 address asynchronously.\n\n### internalIpV6Sync()\n\nReturns the internal IPv6 address synchronously.\n\n### internalIpV4Sync()\n\nReturns the internal IPv4 address synchronously.\n\n## Related\n\n- [internal-ip-cli](https://github.com/sindresorhus/internal-ip-cli) - CLI for this package\n- [public-ip](https://github.com/sindresorhus/public-ip) - Get your public IP address\n- [default-gateway](https://github.com/silverwind/default-gateway) - Get your default gateway address\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Finternal-ip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsindresorhus%2Finternal-ip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Finternal-ip/lists"}