relateurl
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
RelateUrl is a powerful JavaScript utility that minifies URLs, converting them from absolute URLs to relative URLs. It performs string parsing and does not require directory browsing. It's highly optimized, delivering impressive speed and lightness, all without requiring any external dependencies.
To start using RelateUrl, you need to have Node.js (version 0.10 or later) installed on your machine. You can then install the package by typing the following command in your terminal:
npm install relateurl --save-dev
RelateUrl can be used either as a function for single-use or as a class for multiple conversions.
Here's an example of single-use:
var RelateUrl = require("relateurl");
var result = RelateUrl.relate(from, to, options);
And here's how you can create reusable instances:
var RelateUrl = require("relateurl");
var instance = new RelateUrl(from, options);
var result1 = instance.relate(to1);
var result2 = instance.relate(to2, customOptions);
var result3 = instance.relate(to3);
In these examples, from
and to
are the URLs you want to convert, and options
is an optional object where you can specify various settings, such as whether to ignore 'www', or whether to remove authentication info from the URL.
For comprehensive information about RelateUrl and its uses, refer to its GitHub page. The README file on this page provides detailed instructions on how to install and utilize the tool, its features and options, and also gives code examples. Additional updates about the tool's release history and roadmap can also be found on this page.