# urlbitbucket-to-object

> Extract user, repo, and other interesting properties from Bitbucket URLs

Latest version **1.0.1** (published 2024-03-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install urlbitbucket-to-object
pnpm add urlbitbucket-to-object
yarn add urlbitbucket-to-object
bun add urlbitbucket-to-object
```

## 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.1 |
| Published | 2024-03-03 |
| First published | 2024-02-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 10.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | leiz95 |
| Maintainers | leiz1995 |
| Keywords | bitbucket, url, repo |

## Links

- npm: https://www.npmjs.com/package/urlbitbucket-to-object
- Repository: https://github.com/leiz95/URLBitbucket-to-object
- Homepage: https://github.com/leiz95/URLBitbucket-to-object#readme
- Issues: https://github.com/leiz95/URLBitbucket-to-object/issues
- npm.io page: https://npm.io/package/urlbitbucket-to-object

## Dependencies (2)

- [is-url](https://npm.io/package/is-url.md) ^1.1.0
- [urlgithub-to-object](https://npm.io/package/urlgithub-to-object.md) ^1.0.0

## 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

- 1.0.1 (latest) — 2024-03-03
- 1.0.0 — 2024-02-27

## README

# URLBitbucket-to-object

A node module that extracts useful properties like `user` and
`repo` from various flavors of bitbucket URLs.

There's also a GitHub equivalent to this library: [urlgithub-to-object](https://github.com/leiz95/URLgithub-to-object).

## Installation

```sh
npm install urlbitbucket-to-object --save
```

## Usage

Pass whatever flavor of bitbucket URL you like:

```js
var bb = require('urlbitbucket-to-object')

bb('example/business')
bb('bitbucket:example/business')
bb('https://bitbucket.org/example/business')
bb('https://bitbucket.org/example/business.git')
bb('http://bitbucket.org/example/business')
bb('git://bitbucket.org/example/business.git')
```

Here's what you'll get:

```js
{
  user: 'example',
  repo: 'business',
  branch: 'master',
  https_url: 'https://bitbucket.org/example/business',
  tarball_url: 'https://bitbucket.org/example/business/get/master.tar.gz'
  travis_url: 'https://travis-ci.org/example/business',
}
```

The shorthand format lets you specify a branch:

```js
  bb('example/business#nachos')
{
  user: 'example',
  repo: 'business',
  branch: 'nachos',
  https_url: 'https://bitbucket.org/example/business/tree/nachos',
  tarball_url: 'https://bitbucket.org/example/business/get/nachos.tar.gz'
  travis_url: 'https://travis-ci.org/example/business',
}
```

If you provide a non-bitbucket URL or a falsy value, you'll get `null`.

## Test

```sh
npm install
npm test
```

## License

MIT

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