Ministry of Technology
Show Menu

URL Navigator

URL Navigator
Created by Ministry
Language
JavaScript (ES5)
Type
Web

This project provides simple functions for working with URLs, wrapping the location object.

Here's some examples...

var urlNavigator = require("url-navigator");

var protocol = urlNavigator.current.protocol();
var host = urlNavigator.current.host();
var url = urlNavigator.current.href();
var urlParameter = urlNavigator.current.urlParameter("search");

urlNavigator.go("http://www.google.co.uk");

urlNavigator.redirect("http://www.google.com");

var fishString = urlNavigator.getParameter("http://www.google.co.uk?name=keith&search=fish&color=red", "search")
Visit us on GitHub