kriskowal / url2

Augments Node.js’s URL library
MIT License
6 stars 6 forks source link

URL2

This module builds upon the existing URL module in NodeJS, but adds relative(source, target) which returns the shortest relative path between any two equally qualified URL’s. If the paths are not equally qualified, it returns the target.

In addition, this package augments the URL object definition as returned by parse and consumed by format.

Additionally, format uses the path property if it exists, instead of pathname and search.


Based on my earlier work for Narwhal.

Copyright 2012 Kristopher Michael Kowal. All rights reserved. MIT License