https://github.com/brittonhayes/defangle
🧛 Defangle is the gleam link defanger. Make URLs, IPs, and Emails safe to share.
https://github.com/brittonhayes/defangle
defang erlang gleam infosec security
Last synced: 4 months ago
JSON representation
🧛 Defangle is the gleam link defanger. Make URLs, IPs, and Emails safe to share.
- Host: GitHub
- URL: https://github.com/brittonhayes/defangle
- Owner: brittonhayes
- Created: 2024-03-16T20:12:26.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-19T06:00:26.000Z (over 1 year ago)
- Last Synced: 2025-03-09T23:17:42.863Z (4 months ago)
- Topics: defang, erlang, gleam, infosec, security
- Language: Gleam
- Homepage:
- Size: 836 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🦇 defangle
[](https://hex.pm/packages/defangle)
[](https://hexdocs.pm/defangle/)Defangle is a Gleam library for defanging URLs, Emails, and IP addresses making them safe to share.
## 📥 Install defangle
```sh
gleam add defangle
```## âš¡ Usage
```gleam
import defanglepub fn main() {
// Defang a URL, email, or IP address to make it safe to share
"https://www.suspicious-url.com"
|> defangle.defang
// "hxxps[://]www[.]suspicious-url[.]com"
// Defang a URL to make it safe to share
"https://www.suspicious-url.com"
|> defangle.defang_url
// "hxxps[://]www[.]suspicious-url[.]com"// Defang an email address to make it safe to share
"[email protected]"
|> defangle.defang_email
// "lucy[at]suspicious-url[.]com"// Defang an IPv4 address to make it safe to share. Doesn't support IPv6 yet.
"103.253.144.32"
|> defangle.defang_ip
// "103[.]253[.]144[.]32"
}
```Further documentation can be found at .
## Development
```sh
gleam run # Run the project
gleam test # Run the tests
gleam shell # Run an Erlang shell
```