1.0.2 • Published 1 year ago

extract_url_from_string v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Extract url from string

Extract all URLs from a string

 npm install extract_url_from_string
 # or
 yarn add extract_url_from_string
const extractUrl = require("extract_url_from_string");

const text =
  "Here is my text with some urls to test the first url is example.com but it also has url example.com/login or example.com?id=extractUrl";

(async () => {
  try {
    const urls = await extractUrl(text);
    /*
     URLs will return [
       "example.com",
       "example.com/login",
       "example.com?id=extractUrl"
     ]
     */
    console.log(urls);
  } catch (error) {
    console.log(error);
  }
})();
1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago