sporto/erl/3.0.0

NOTE: this package is not compatible with Elm 0.19.1

Erl

Codeship Status for sporto/erl

A URL parsing library for ELM

Documentation at package.elm-lang.org

Parse

Given a url like:

url = http://sam:[email protected]:3000/products/kids#toys/1?color=red&age=10

Erl.parse url 

Returns:

{
  protocol: "http",
  username: "sam",
  password: "pass",
  host: ["api", "example", "com"],
  port': 3000,
  path: ["products", "kids"],
  fragment: ["toys", "1"],
  query: Dict {
    "color": "red",
    "age": "10"
  }
}

Test

npm i
npm test

Todo

  • Username
  • Password
  • Create empty Url
  • Convenience methods for updating parts
  • Methods for adding to query / replacing / removing / cleaning