https://github.com/segmentio/use-https
Detemine whether scripts need to be loaded over HTTPS.
https://github.com/segmentio/use-https
grim-repo-ignore paused
Last synced: 6 months ago
JSON representation
Detemine whether scripts need to be loaded over HTTPS.
- Host: GitHub
- URL: https://github.com/segmentio/use-https
- Owner: segmentio
- Created: 2013-10-29T00:34:23.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2023-10-05T18:26:44.000Z (over 1 year ago)
- Last Synced: 2024-12-12T04:19:15.523Z (7 months ago)
- Topics: grim-repo-ignore, paused
- Language: JavaScript
- Homepage:
- Size: 30.3 KB
- Stars: 3
- Watchers: 38
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# use-https
> **Note**
> Segment has paused maintenance on this project, but may return it to an active status in the future. Issues and pull requests from external contributors are not being considered, although internal contributions may appear from time to time. The project remains available under its open source license for anyone to use.Determine whether scripts need to be loaded over HTTPS for the page to remain secure.
## Installation
$ component install segmentio/use-https
## Example
At `https://example.com`...
```js
var https = require('use-https');https(); // true
https('//site.com'); // "https://site.com"
```## API
### useHttps()
Return a `Boolean` of whether you need to load any scripts over HTTPS to keep the document secure.### useHttps(agnosticUrl)
Return the `agnosticUrl` (starts with `//`) with either `https:` or `http:` prepended as the protocol.## License
MIT