Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/denorg/get-ip
🌐 Get your public IP address in Deno
https://github.com/denorg/get-ip
deno denoland denorg ip ipv4 ipv6 typescript
Last synced: 3 months ago
JSON representation
🌐 Get your public IP address in Deno
- Host: GitHub
- URL: https://github.com/denorg/get-ip
- Owner: denorg
- License: mit
- Created: 2020-05-23T03:22:41.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-03T11:28:40.000Z (over 4 years ago)
- Last Synced: 2024-10-17T18:46:34.479Z (4 months ago)
- Topics: deno, denoland, denorg, ip, ipv4, ipv6, typescript
- Language: TypeScript
- Homepage: https://denorg.github.io/get-ip/
- Size: 26.4 KB
- Stars: 7
- Watchers: 6
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# 🌐 Get IP
Get your public IP address in Deno.
[![Deno CI](https://github.com/denorg/get-ip/workflows/Deno%20CI/badge.svg)](https://github.com/denorg/get-ip/actions)
[![GitHub](https://img.shields.io/github/license/denorg/get-ip)](https://github.com/denorg/get-ip/blob/master/LICENSE)
[![Contributors](https://img.shields.io/github/contributors/denorg/get-ip)](https://github.com/denorg/get-ip/graphs/contributors)
[![Deno Starter](https://img.shields.io/badge/deno-starter-brightgreen)](https://denorg.github.io/starter/)
[![Made by Denorg](https://img.shields.io/badge/made%20by-denorg-0082fb)](https://github.com/denorg)
[![TypeScript](https://img.shields.io/badge/types-TypeScript-blue)](https://github.com/denorg/get-ip)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)## ⭐ Getting started
Import the `getIP` function and use it:
```ts
import { getIP } from "https://deno.land/x/get_ip/mod.ts";const getMyIP = async () => {
console.log(`Your public IP is ${await getIP({ipv6: true})}`);
}getMyIP();
```### CLI with [DPX](https://github.com/denorg/dpx)
After [installing DPX](https://github.com/denorg/dpx), you can directly use the CLI using the `dpx` command:
```bash
dpx get_ip
# 123.456.789.012
```### CLI
Alternatively, you can use it directly from the CLI by using `deno run`:
```bash
deno run --allow-net https://deno.land/x/get_ip/cli.ts
# 123.456.789.012
```You can also install it globally using the following:
```bash
deno install --allow-net -n get-ip https://deno.land/x/get_ip/cli.ts
```Then, the package is available to run:
```bash
get_ip
# 123.456.789.012
```### Configuration
Required permissions:
1. `--allow-net`
## 👩💻 Development
Run tests:
```bash
deno test --allow-net
```## 📄 License
MIT © [Denorg](https://den.org.in)
A project by Denorg, the world's first Deno-focused community
organization and consulting company. Work with us →