2.0.1 • Published 12 months ago

prepend-tls v2.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
12 months 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

12 months ago

2.0.0

1 year ago

1.3.0

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago