A package that builds URLs through JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
README.md
index.js
package.json

README.md

url-builder

A package that builds URLs through JavaScript

Usage

const url = new URL().isWWW(false).isHTTP(false).setDomain("github").setEnding("com").addDirectory("galactic-packages").addDirectory("url-builder").getURL();
console.log(url);

This outputs https://github.com/galactic-packages/url-builder/

Types

Attribute Data Type Description
URL() class Used to set the URL object
.isWWW() boolean Specifies if the domain includes www
.isHTTP() boolean Specifies if the domain is http or https
.setSubdomain() string Sets the subdomain of the URL
.setDomain() string Sets the domain of the url
.setEnding() string Sets the ending of the url (com, org, net, edu, etc)
.addDirectory() string Add a directory to the URL
.addFile() string Add a file, (ie, pdf, html)
.getURL() none Returns the whole URL, with the settings specified above

Optional Settings

The settings above are optional excluding .setDomain() and .setEnding(). All other settings are set automatically, unless specified by the user.