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

prepend-http

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prepend-http

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

  • 4.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9.5M
decreased by-5.34%
Maintainers
1
Weekly downloads
 
Created

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

Keywords

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

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