Socket
Socket
Sign inDemoInstall

linkfollower

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

linkfollower - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

cli.js

@@ -7,3 +7,3 @@ #!/usr/bin/env node

if (!link) {
console.log('Usage: linkfollower <URL>');
console.log('Usage: follow <URL>');
process.exit(1);

@@ -10,0 +10,0 @@ }

@@ -9,4 +9,5 @@ const http = require('http');

return new Promise((resolve, reject) => {
link = prefixWithHttp(link);
let parsedUrl = url.parse(link);
if (parsedUrl.protocol == null || parsedUrl.host == null) {
if (parsedUrl.host == null) {
reject(link + ' is not a valid URL');

@@ -71,2 +72,11 @@ }

let prefixWithHttp = function(link) {
let pattern = new RegExp('^http');
if (!pattern.test(link)) {
return 'http://' + link;
}
return link;
}
exports.follow = follow;
{
"name": "linkfollower",
"version": "1.0.2",
"version": "1.0.3",
"description": "Node.js based command line utility that lets you follow redirects to see where http URLs end up. Useful for shortened URLs.",

@@ -5,0 +5,0 @@ "main": "cli.js",

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