to-protocol-relative-url
Change a URL into protocol-relative URL
Last updated 5 years ago by shinnn .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install to-protocol-relative-url 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 1.0.3                                ...           latest (5 years ago)

5 Versions

  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           6 years ago
  • 0.0.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (6)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |