prepend_http 1.0.0

Prepend `https://` to humanized URLs.

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

Install

$ npm install prepend_http

Usage

import 'package:prepend_http/prepend_http.dart';

main() {
  prependHttp('localhost', https: false);
  //=> 'http://localhost'
  prependHttp('sindresorhus.com');
  //=> 'https://sindresorhus.com'
  prependHttp('https://sindresorhus.com');
  //=> 'https://sindresorhus.com'
}

API

prependHttp(url, [options])

url

Type: String

URL to prepend https:// to.

https

Type: boolean
Default: true

Prepend https:// instead of http://.

License

MIT © Sindre Sorhus