# ssh-url

> Utilities to resolute and parse ssh url including scp-like syntax SSH protocol.

Latest version **0.1.5** (published 2014-07-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install ssh-url
pnpm add ssh-url
yarn add ssh-url
bun add ssh-url
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2014-07-03 |
| First published | 2014-05-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.8.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | kael |
| Maintainers | kael |
| Keywords | ssh-url |

## Links

- npm: https://www.npmjs.com/package/ssh-url
- Repository: git@github.com:kaelzhang/node-ssh-url
- Homepage: https://github.com/kaelzhang/node-ssh-url
- Issues: https://github.com/kaelzhang/node-ssh-url/issues
- npm.io page: https://npm.io/package/ssh-url

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 0.1.5 (latest) — 2014-07-03
- 0.1.4 — 2014-06-17
- 0.1.3 — 2014-05-18
- 0.1.2 — 2014-05-18
- 0.1.1 — 2014-05-18
- 0.1.0 — 2014-05-18

## README

# ssh-url [![NPM version](https://badge.fury.io/js/ssh-url.svg)](http://badge.fury.io/js/ssh-url) [![Build Status](https://travis-ci.org/kaelzhang/node-ssh-url.svg?branch=master)](https://travis-ci.org/kaelzhang/node-ssh-url) [![Dependency Status](https://gemnasium.com/kaelzhang/node-ssh-url.svg)](https://gemnasium.com/kaelzhang/node-ssh-url)

Utilities to resolute and parse ssh url including scp-like syntax SSH protocol.

## Installation

```bash
$ npm install ssh-url --save
```

## Usage

```js
var url = require('ssh-url');

var parsed = url.parse('git@github.com:kaelzhang/node-ssh-url.git');
// -> {
//   protocol: null,
//   user: 'git',
//   hostname: 'github.com',
//   pathname: '/kaelzhang/node-ssh-url.git'
// }

url.format(parsed);
// -> git@github.com:kaelzhang/node-ssh-url.git
```

### url.parse(urlStr)

Takes a SSH URL string, and returns an object.

#### urlObj

For now, `urlObj` only contains four properties.

- protocol `null|String` if null, indicates that `urlStr` uses scp-like syntax.
- user `String`
- hostname `String` for now, there's no port.
- pathname `String` starts with `'/'`

### url.format(urlObj)

Takes a parsed SSH URL object, and returns a formatted URL string.

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