Skip to content

🧛 Defangle is the gleam link defanger. Make URLs, IPs, and Emails safe to share.

Notifications You must be signed in to change notification settings

brittonhayes/defangle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🦇 defangle

Package Version Hex Docs

Defangle is a Gleam library for defanging URLs, Emails, and IP addresses making them safe to share.

📥 Install defangle

gleam add defangle

âš¡ Usage

import defangle

pub 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
  "lucy@malicious.gleam"
  |> 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 https://hexdocs.pm/defangle.

Development

gleam run   # Run the project
gleam test  # Run the tests
gleam shell # Run an Erlang shell

About

🧛 Defangle is the gleam link defanger. Make URLs, IPs, and Emails safe to share.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages