Permalink
Browse files

minor readme update

  • Loading branch information...
1 parent 7c5f9a5 commit 2182e70563e3875607ebcd6d88c1de0bad1ad515 @addyosmani committed Oct 14, 2011
Showing with 71 additions and 1 deletion.
  1. +71 −1 README.md
View
@@ -1,3 +1,73 @@
Parsley is a JavaScript URL-parser for breaking down both simple and complex URL strings into their component elements. This is achieved primarily through regular expressions with iteration used for extending the break-down of query, path and hash portions of a URL.
-Tests coming soon.
+usage:
+
+parsely( url ); //parsely('http://google.com');
+
+Supported URL patterns include:
+
+"http:",
+"https://",
+"http://host",
+"http://host/",
+"http://host.com",
+"http://subdomain.host.com",
+"http://host.com:81",
+"http://user@host.com",
+"http://user@host.com:81",
+"http://user:@host.com",
+"http://user:@host.com:81",
+"http://user:pass@host.com",
+"http://user:pass@host.com:81",
+"http://user:pass@host.com:81?query",
+"http://user:pass@host.com:81#anchor",
+"http://user:pass@host.com:81/",
+"http://user:pass@host.com:81/?query",
+"http://user:pass@host.com:81/#anchor",
+"http://user:pass@host.com:81/file.ext",
+"http://user:pass@host.com:81/directory",
+"http://user:pass@host.com:81/directory?query",
+"http://user:pass@host.com:81/directory#anchor",
+"http://user:pass@host.com:81/directory/",
+"http://user:pass@host.com:81/directory/?query",
+"http://user:pass@host.com:81/directory/#anchor",
+"http://user:pass@host.com:81/directory/sub.directory/",
+"http://user:pass@host.com:81/directory/sub.directory/file.ext",
+"http://user:pass@host.com:81/directory/file.ext?query",
+"http://user:pass@host.com:81/directory/file.ext?query=1&test=2",
+"http://user:pass@host.com:81/directory/file.ext?query=1#anchor",
+"//host.com",
+"//user:pass@host.com:81/direc.tory/file.ext?query=1&test=2#anchor/anchor2",
+"/directory/sub.directory/file.ext?query=1&test=2#anchor",
+"/directory/",
+"/file.ext",
+"/?query",
+"/#anchor",
+"/",
+"?query",
+"?query=1&test=2#anchor",
+"#anchor",
+"path/to/file",
+"localhost",
+"192.168.1.1",
+"host.com",
+"host.com:81",
+"host.com:81/",
+"host.com?query",
+"host.com#anchor",
+"host.com/",
+"host.com/file.ext",
+"host.com/directory/?query",
+"host.com/directory/#anchor",
+"host.com/directory/file.ext",
+"host.com:81/direc.tory/file.ext?query=1&test=2#anchor",
+"user@host.com",
+"user@host.com:81",
+"user@host.com/",
+"user@host.com/file.ext",
+"user@host.com?query",
+"user@host.com#anchor",
+"user:pass@host.com:81/direc.tory/file.ext?query=1&test=2#anchor"
+
+Due to the need for testing to factor in more than just the correct number of objects output, tests might take another few days to wrap up but they are coming.
+

0 comments on commit 2182e70

Please sign in to comment.