Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinnn/to-protocol-relative-url.js
Change a URL into protocol-relative URL
https://github.com/shinnn/to-protocol-relative-url.js
Last synced: 26 days ago
JSON representation
Change a URL into protocol-relative URL
- Host: GitHub
- URL: https://github.com/shinnn/to-protocol-relative-url.js
- Owner: shinnn
- License: mit
- Created: 2014-09-03T11:09:35.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-07-26T15:52:06.000Z (over 9 years ago)
- Last Synced: 2024-04-25T11:02:03.991Z (7 months ago)
- Language: JavaScript
- Size: 199 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# to-protocol-relative-url.js
[![NPM version](https://img.shields.io/npm/v/to-protocol-relative-url.svg)](https://www.npmjs.com/package/to-protocol-relative-url)
[![Bower version](https://img.shields.io/bower/v/to-protocol-relative-url.svg)](https://github.com/shinnn/to-protocol-relative-url.js/releases)
[![Build Status](https://travis-ci.org/shinnn/to-protocol-relative-url.js.svg?branch=master)](https://travis-ci.org/shinnn/to-protocol-relative-url.js)
[![Build status](https://ci.appveyor.com/api/projects/status/o7y9vb7ykec27qmn?svg=true)](https://ci.appveyor.com/project/ShinnosukeWatanabe/to-protocol-relative-url-js)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/to-protocol-relative-url.js.svg?label=cov)](https://coveralls.io/r/shinnn/to-protocol-relative-url.js?branch=master)
[![Dependency Status](https://img.shields.io/david/shinnn/to-protocol-relative-url.js.svg?label=deps)](https://david-dm.org/shinnn/to-protocol-relative-url.js)
[![devDependency Status](https://img.shields.io/david/shinnn/to-protocol-relative-url.js.svg?label=devDeps)](https://david-dm.org/shinnn/to-protocol-relative-url.js#info=devDependencies)Change a URL into [protocol-relative URL](https://www.paulirish.com/2010/the-protocol-relative-url/)
## Installation
### Package managers
#### [npm](https://www.npmjs.com/)
```
npm install --save to-protocol-relative-url
```#### [Bower](http://bower.io/)
```
bower install --save to-protocol-relative-url
```### Standalone
[Download the script file directly.](https://raw.githubusercontent.com/shinnn/to-protocol-relative-url.js/master/to-protocol-relative-url.js)
## API
### toProtocolRelativeUrl(*url*)
*url*: `String`
Return: `String````javascript
toProtocolRelativeURL('http://example.org');
//=> //example.orgtoProtocolRelativeURL('https://github.com/');
//=> //github.com/toProtocolRelativeURL('[email protected]:npm/npm.git');
//=> [email protected]: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](https://docs.npmjs.com/files/folders#global-installation).
```
npm install -g to-protocol-relative-url
```### Usage
```
Usage1: to-protocol-relative-url
Usage2: echo | to-protocol-relative-urlOptions:
--help, -h Print usage information
--version, -v Print version
```## License
Copyright (c) 2014 - 2015 [Shinnosuke Watanabe](https://github.com/shinnn)
Licensed under [the MIT License](./LICENSE).