# hasprotocol

> Returns true/false if string starts protocol such as http://

Latest version **1.0.3** (published 2019-04-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install hasprotocol
pnpm add hasprotocol
yarn add hasprotocol
bun add hasprotocol
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2019-04-22 |
| First published | 2017-06-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | TidySource |
| Maintainers | danielcobo |
| Keywords | protocol, string, regex |

## Links

- npm: https://www.npmjs.com/package/hasprotocol
- Repository: https://github.com/tidysource/hasprotocol
- Homepage: https://github.com/tidysource/hasprotocol#readme
- Issues: https://github.com/tidysource/hasprotocol/issues
- npm.io page: https://npm.io/package/hasprotocol

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.0.3 (latest) — 2019-04-22
- 1.0.2 — 2019-04-13
- 1.0.1 — 2017-06-10
- 1.0.0 — 2017-06-09

## README

# hasprotocol
Returns true/false if string starts with a protocol such as http

```javascript
hasProtocol('http://') //true
hasProtocol('http://hello') //true
hasProtocol('helloworldhttp://hello') //false


hasProtocol('https://') //true
hasProtocol('https://hello') //true
hasProtocol('helloworldhttps://hello') //false


hasProtocol('localhost://') //true
hasProtocol('localhost://hello') //true
hasProtocol('helloworldlocalhost://hello') //false


hasProtocol('file:///') //true
hasProtocol('file:///') //true
hasProtocol('helloworldfile:///') //false
```

---
_Source: https://npm.io/package/hasprotocol · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
