🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

prepend-http

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
p

prepend-http

Prepend `https://` to humanized URLs like sindresorhus.com and localhost

4.0.0
latest
100

Supply Chain Security

100

Vulnerability

80

Quality

76

Maintenance

100

License

Version published
Weekly downloads
9.6M
-13.33%
Maintainers
1
Weekly downloads
 
Created
Issues
1

What is prepend-http?

The prepend-http npm package is a utility that ensures a URL has a protocol (http or https) prepended to it. This is useful for normalizing URLs and ensuring they are valid for HTTP requests.

What are prepend-http's main functionalities?

Prepend HTTP to URL

This feature allows you to prepend 'http://' to a URL if it does not already have a protocol. This is useful for ensuring that URLs are valid for HTTP requests.

const prependHttp = require('prepend-http');
const url = 'example.com';
const fullUrl = prependHttp(url);
console.log(fullUrl); // 'http://example.com'

Prepend HTTPS to URL

This feature allows you to prepend 'https://' to a URL if it does not already have a protocol. This is useful for ensuring that URLs are secure.

const prependHttp = require('prepend-http');
const url = 'example.com';
const fullUrl = prependHttp(url, {https: true});
console.log(fullUrl); // 'https://example.com'

Other packages similar to prepend-http

FAQs

Package last updated on 09 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts