An open API service indexing awesome lists of open source software.

https://github.com/chrisvogt/to-https

Transform HTTP URLs and IP addresses to HTTPS URLs
https://github.com/chrisvogt/to-https

convert ftp http https path ssl transform

Last synced: 22 days ago
JSON representation

Transform HTTP URLs and IP addresses to HTTPS URLs

Awesome Lists containing this project

README

          

# to-https [![codecov](https://codecov.io/gh/chrisvogt/to-https/badge.svg?branch=master)](https://codecov.io/gh/chrisvogt/to-https?branch=master)

> Convert (almost) any url to https.

## Install

```
$ npm install to-https
```

## Usage

```js
const toHttps = require('to-https');

toHttps('http://www.chrisvogt.me');
//=> 'https://www.chrisvogt.me'

toHttps('//my.cdn.com/image.png');
//=> 'https://my.cdn.com/image.png'

toHttps('127.0.0.1');
//=> 'https://127.0.0.1'
```

## API

### toHttps(input)

#### input

Type: `string`

The url or address to convert to HTTPS.

## License

MIT © [Chris Vogt](https://www.chrisvogt.me)