Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

get-urls

Package Overview
Dependencies
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-urls - npm Package Compare versions

Comparing version 5.0.1 to 6.0.0

14

index.js
'use strict';
var arrayUniq = require('array-uniq');
var urlRegex = require('url-regex');
var normalizeUrl = require('normalize-url');
const arrayUniq = require('array-uniq');
const urlRegex = require('url-regex');
const normalizeUrl = require('normalize-url');
module.exports = function (str, opts) {
var urls = str.match(urlRegex());
module.exports = (str, opts) => {
const urls = str.match(urlRegex());

@@ -13,5 +13,3 @@ if (!urls) {

return arrayUniq(urls.map(function (url) {
return normalizeUrl(url.trim().replace(/\.*$/, ''), opts);
}));
return arrayUniq(urls.map(url => normalizeUrl(url.trim().replace(/\.+$/, ''), opts)));
};
{
"name": "get-urls",
"version": "5.0.1",
"description": "Get all urls in a string",
"version": "6.0.0",
"description": "Get all URLs in a string",
"license": "MIT",

@@ -12,5 +12,4 @@ "repository": "sindresorhus/get-urls",

},
"bin": "cli.js",
"engines": {
"node": ">=0.10.0"
"node": ">=4"
},

@@ -21,12 +20,9 @@ "scripts": {

"files": [
"index.js",
"cli.js"
"index.js"
],
"keywords": [
"cli-app",
"cli",
"get",
"urls",
"url",
"uri",
"get",
"extract",

@@ -36,11 +32,8 @@ "find",

"text",
"string",
"browser"
"string"
],
"dependencies": {
"array-uniq": "^1.0.0",
"get-stdin": "^4.0.1",
"meow": "^3.3.0",
"normalize-url": "^1.3.0",
"url-regex": "^3.2.0"
"url-regex": "^4.0.0"
},

@@ -47,0 +40,0 @@ "devDependencies": {

# get-urls [![Build Status](https://travis-ci.org/sindresorhus/get-urls.svg?branch=master)](https://travis-ci.org/sindresorhus/get-urls)
> Get all urls in a string
> Get all URLs in a string
The urls will be [normalized](https://github.com/sindresorhus/normalize-url) and uniquified.
The URLs will be [normalized](https://github.com/sindresorhus/normalize-url) and uniquified.

@@ -18,3 +18,3 @@

```js
var text = 'Lorem ipsum dolor sit amet, //sindresorhus.com consectetuer adipiscing http://yeoman.io elit.';
const text = 'Lorem ipsum dolor sit amet, //sindresorhus.com consectetuer adipiscing http://yeoman.io elit.';

@@ -28,7 +28,6 @@ getUrls(text);

### getUrls(text, [options]);
### getUrls(text, [options])
### text
*Required*
Type: `string`

@@ -38,3 +37,3 @@

Type: `object`
Type: `Object`

@@ -44,19 +43,9 @@ See the `normalize-url` [options](https://github.com/sindresorhus/normalize-url#options).

## CLI
## Related
```
$ npm install --global get-urls
```
- [get-urls-cli](https://github.com/sindresorhus/get-urls-cli) - CLI for this module
```
$ get-urls --help
Usage
get-urls <file>
cat <file> | get-urls
```
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)
MIT © [Sindre Sorhus](https://sindresorhus.com)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc