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: github-url-to-object.
Installation
npm install bitbucket-url-to-object --save
Usage
Pass whatever flavor of bitbucket URL you like:
var bb =
Here's what you'll get:
user: 'monkey' repo: 'business' branch: 'master' https_url: 'https://bitbucket.org/monkey/business' tarball_url: 'https://bitbucket.org/monkey/business/get/master.tar.gz' travis_url: 'https://travis-ci.org/monkey/business'
The shorthand format lets you specify a branch:
user: 'monkey' repo: 'business' branch: 'nachos' https_url: 'https://bitbucket.org/monkey/business/tree/nachos' tarball_url: 'https://bitbucket.org/monkey/business/get/nachos.tar.gz' travis_url: 'https://travis-ci.org/monkey/business'
If you provide a non-bitbucket URL or a falsy value, you'll get null
.
Test
npm installnpm test
License
MIT