Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joakimunge/deno-local-ip
Tiny module for Deno to get local network interface address.
https://github.com/joakimunge/deno-local-ip
deno denoland ip ipaddress module network-interfaces tiny typescript
Last synced: 3 months ago
JSON representation
Tiny module for Deno to get local network interface address.
- Host: GitHub
- URL: https://github.com/joakimunge/deno-local-ip
- Owner: joakimunge
- License: mit
- Created: 2020-06-02T10:19:25.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-19T15:44:55.000Z (almost 4 years ago)
- Last Synced: 2024-10-17T06:11:11.852Z (4 months ago)
- Topics: deno, denoland, ip, ipaddress, module, network-interfaces, tiny, typescript
- Language: TypeScript
- Size: 4.88 KB
- Stars: 7
- Watchers: 1
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Deno Local Ip
Tiny module for Deno to get local network interface address.
_Does work on windows, linux and macOS!_
## Usage
> NOTE: Requires the all mighty `--allow-run` option as it spawns the subprocess `ifconfig`/`ipconfig` under the hood, to fetch the network interfaces.
```typescript
import { getNetworkAddr } from 'https://deno.land/x/local_ip/mod.ts';const netAddr = await getNetworkAddr(); // 192.168.0.17
```## Reasoning
Currently Deno does not provide a way to access local network interfaces. Sometimes this is useful when you need to know your local network address.
When this implementation gets finished, this module will probably be deprecated: https://github.com/denoland/deno/issues/3802