{"id":26063257,"url":"https://github.com/kitten/lan-network","last_synced_at":"2026-03-08T01:06:14.693Z","repository":{"id":278777660,"uuid":"936768194","full_name":"kitten/lan-network","owner":"kitten","description":"Best-effort discovery of the machine's local network using just Node.js dgram sockets","archived":false,"fork":false,"pushed_at":"2026-02-06T09:49:51.000Z","size":105,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-17T05:08:36.501Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/lan-network","language":"TypeScript","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/kitten.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-21T16:47:59.000Z","updated_at":"2026-02-06T09:49:20.000Z","dependencies_parsed_at":"2025-02-21T17:22:02.985Z","dependency_job_id":"e1582cef-7d5e-4eb3-8484-5c6510d5eb4a","html_url":"https://github.com/kitten/lan-network","commit_stats":null,"previous_names":["kitten/lan-network"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/kitten/lan-network","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitten%2Flan-network","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitten%2Flan-network/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitten%2Flan-network/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitten%2Flan-network/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kitten","download_url":"https://codeload.github.com/kitten/lan-network/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitten%2Flan-network/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30240349,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T00:58:18.660Z","status":"ssl_error","status_checked_at":"2026-03-08T00:55:48.608Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2025-03-08T16:34:25.890Z","updated_at":"2026-03-08T01:06:14.670Z","avatar_url":"https://github.com/kitten.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lan-network\n\n**Best-effort discovery of the machine's default gateway and local network IPv4 address exclusively with UDP sockets.**\n\nThis utility attempts to determine the interface and IPv4 address of a machine\non the local network. It'll attempt to determine the default gateway and\nreturn the corresponding network interface assignment, both when the network\nis online and offline.\n\nThe LAN Network it attempts to pick is the one that the machine uses to connect\nto the internet. Determining it is useful to pick the machine's IP address that\nis generally used to connect to it from other devices on the network.\n\n`lanNetwork()` makes three separate attempts to guess the local network:\n\n1. Create a socket to a publicly routed IP, and return the assignment matching the socket's local address\n2. Broadcast DHCP discovery packets on all routable network assignments and listen for replies\n3. Highest priority assignment\n\n`lanNetworkSync()` does the same synchronously by spawning a child process\nand blocking until a result is determined. Using this method is generally\nnot recommended.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitten%2Flan-network","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkitten%2Flan-network","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitten%2Flan-network/lists"}