node package manager

get-urls

Get all urls in a string

get-urls Build Status

Get all urls in a string

The urls will be normalized and uniquified.

Install

$ npm install --save get-urls

Usage

var text = 'Lorem ipsum dolor sit amet, //sindresorhus.com consectetuer adipiscing http://yeoman.io elit.';
 
getUrls(text);
//=> ['http://sindresorhus.com', 'http://yeoman.io'] 

API

getUrls(text, [options]);

text

Required
Type: string

options

Type: object

See the normalize-url options.

CLI

$ npm install --global get-urls
$ get-urls --help
 
  Usage
    get-urls <file>
    cat <file> | get-urls

License

MIT © Sindre Sorhus