From 7ada64cfa63b0bceee12646310616eb9d2ed22aa Mon Sep 17 00:00:00 2001 From: Luke Childs <lukechilds123@gmail.com> Date: Sat, 23 Apr 2016 08:50:13 +0100 Subject: [PATCH] Format markdown better --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index cbedfeb..22409ff 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ # my-name-is-url [](https://travis-ci.org/lukechilds/my-name-is-url) [](https://coveralls.io/github/lukechilds/my-name-is-url?branch=master) + Intelligently finds many different url formats in a string. For the browser and node. ## About + In a nutshell, `my-name-is-url` is an intelligent parser that searches a string of text for urls. The url spec is so vague that almost anything _could_ be a url. The regular expression used in `my-name-is-url` tries to match patterns likely to represent a url in a sentence rather than matching the actual url spec. > ❗️**Important note** @@ -9,34 +11,43 @@ In a nutshell, `my-name-is-url` is an intelligent parser that searches a string > If you're trying to parse a url into sections (scheme,host) or check a url is valid this module isn't for you. This module is intended to find urls in a string. ## Install + ```shell $ npm install --save my-name-is-url ``` + or + ```shell $ jspm install npm:my-name-is-url ``` ## Usage + Import the module #### CommonJS + ```js var Urls = require('my-name-is-url'); ``` #### ES6 + ```js import Urls from 'my-name-is-url'; ``` ### Regex + If you just wanna do your own thing the regex used internally is helpfully exposed + ```js const UrlRegex = Urls.regex; ``` ### Get Urls + The `get()` method returns an array of urls in a string ```js @@ -48,6 +59,7 @@ Urls(text).get(); // Returns: ``` ### Filter Urls + The `filter()` method runs a filter on each url in a string ```js @@ -63,4 +75,5 @@ Urls(text).filter(url => `<a href="${url}">${url}</a>`); // Returns: > You can get a parser instance by calling `Urls()` or `new Urls`, whichever you prefer. ## License + MIT © Luke Childs