From ecf9f606c9540f12ba539ddfe7b7827e34388fc7 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 4 Mar 2013 20:54:34 +0100 Subject: [PATCH] doc: add url.resolve() usage examples Fixes #4913. --- doc/api/url.markdown | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/api/url.markdown b/doc/api/url.markdown index 8e6a63d3bbc..7b5f69c20b2 100644 --- a/doc/api/url.markdown +++ b/doc/api/url.markdown @@ -96,4 +96,8 @@ Take a parsed URL object, and return a formatted URL string. ## url.resolve(from, to) Take a base URL, and a href URL, and resolve them as a browser would for -an anchor tag. +an anchor tag. Examples: + + url.resolve('/one/two/three', 'four') // '/one/two/four' + url.resolve('http://example.com/', '/one') // 'http://example.com/one' + url.resolve('http://example.com/one', '/two') // 'http://example.com/two'