1.0.0 • Published 8 years ago
url-builder-js v1.0.0
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.
1.0.0
8 years ago