# remote-commit-url

> Generate a URL for viewing a commit on GitLab, GitHub, BitBucket, and more.

Latest version **0.0.6** (published 2020-01-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install remote-commit-url
pnpm add remote-commit-url
yarn add remote-commit-url
bun add remote-commit-url
```

Provides the command `remote-commit-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.0.6 |
| Published | 2020-01-23 |
| First published | 2019-08-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 4 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Madeleine Daly |
| Maintainers | madeleinedaly |
| Keywords | bitbucket, git, github, gitlab |

## Links

- npm: https://www.npmjs.com/package/remote-commit-url
- Repository: https://github.com/madeleinedaly/remote-commit-url
- Homepage: https://github.com/madeleinedaly/remote-commit-url#readme
- Issues: https://github.com/madeleinedaly/remote-commit-url/issues
- npm.io page: https://npm.io/package/remote-commit-url

## Dependencies (4)

- [meow](https://npm.io/package/meow.md) ^5.0.0
- [git-url-parse](https://npm.io/package/git-url-parse.md) ^11.1.2
- [gitconfiglocal](https://npm.io/package/gitconfiglocal.md) ^2.1.0
- [lodash.template](https://npm.io/package/lodash.template.md) ^4.5.0

## Recent versions

- 0.0.6 (latest) — 2020-01-23
- 0.0.5 — 2019-08-23
- 0.0.4 — 2019-08-23
- 0.0.3 — 2019-08-23
- 0.0.2 — 2019-08-23
- 0.0.1 — 2019-08-22

## README

# remote-commit-url

Generate a URL for viewing a commit in the browser.

## Usage

### CLI

#### Installation

``` shell
$ npm i -g remote-commit-url
```

#### Usage

``` shell
$ remote-commit-url [options]
```

##### Example

``` shell
$ remote-commit-url --commit HEAD~1
# https://github.com/nodejs/node/commit/HEAD~1
```

##### Options

``` shell
--commit      Git commit ref [default: HEAD]
--remote      Git remote [default: origin]
--cwd         Path to git repository [default: .]
--git-dir     Path to git directory [default: $GIT_DIR or .git]
--debug       Print debug info
```

### API

#### Installation

``` shell
$ npm i remote-commit-url
```

#### Usage

``` js
const remoteCommitUrl = require('remote-commit-url');

const commit = 'HEAD~1';
const remote = 'origin';
const cwd = '~/Projects/node';

(async () => {
  const url = await remoteCommitUrl({commit, remote, cwd});
  console.log(url); // "https://github.com/nodejs/node/commit/HEAD~1"
})();
```

## Requirements

Node >= 8

## Supported platforms
* Azure DevOps
* BitBucket
* GitHub
* GitLab
* RhodeCode

## License

MIT

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