url-builder-js

1.0.0 • Public • Published

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
.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.

Package Sidebar

Install

npm i url-builder-js

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • aejester