1.0.3 • Published 9 years ago

to-protocol-relative-url v1.0.3

Weekly downloads
9
License
MIT
Repository
github
Last release
9 years ago

to-protocol-relative-url.js

NPM version Bower version Build Status Build status Coverage Status Dependency Status devDependency Status

Change a URL into protocol-relative URL

Installation

Package managers

npm

npm install --save to-protocol-relative-url

Bower

bower install --save to-protocol-relative-url

Standalone

Download the script file directly.

API

toProtocolRelativeUrl(url)

url: String
Return: String

toProtocolRelativeURL('http://example.org');
//=> //example.org

toProtocolRelativeURL('https://github.com/');
//=> //github.com/

toProtocolRelativeURL('git@github.com:npm/npm.git');
//=> git@github.com:npm/npm.git (doesn't change)

toProtocolRelativeURL('Here is http://nodejs.org');
//=> Here is http://nodejs.org (doesn't change)

CLI

You can use this module as a CLI tool by installing it globally.

npm install -g to-protocol-relative-url

Usage

Usage1: to-protocol-relative-url <string>
Usage2: echo <string> | to-protocol-relative-url

Options:
--help,    -h  Print usage information
--version, -v  Print version

License

Copyright (c) 2014 - 2015 Shinnosuke Watanabe

Licensed under the MIT License.

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

10 years ago

0.0.0

10 years ago