2.0.1 • Published 2 years ago

prepend-tls v2.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

prepend-tls

Prependhttps://orhttp://` scheme to URLs.`

Install

$ npm install prepend-tls

Usage

import prependTLS from 'prepend-tls';

// Prepend https://
prependTLS('jessegoodenough.com');
//=> 'https://jessegoodenough.com'

// Prepend http://
prependTLS('jessegoodenough.com', { httpOnly: true });
//=> 'http://jessegoodenough.com'

// Already included https:// returns url unchanged
prependTLS('https://jessegoodenough.com');
//=> 'https://jessegoodenough.com'

API

prependTLS(url, options?)

url

Type: string

The URL to prepend https:// or http:// to.

options

Type: object

**httpOnly**

Type: boolean

Default: false

Prepend `http://` instead of `https://`
2.0.1

2 years ago

2.0.0

2 years ago

1.3.0

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago