Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinnn/parse-user-branch
Parse a username:branch string that is available for Github commit comparison API
https://github.com/shinnn/parse-user-branch
Last synced: 27 days ago
JSON representation
Parse a username:branch string that is available for Github commit comparison API
- Host: GitHub
- URL: https://github.com/shinnn/parse-user-branch
- Owner: shinnn
- License: mit
- Created: 2016-01-21T08:59:00.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-12-23T23:38:16.000Z (almost 6 years ago)
- Last Synced: 2024-10-11T20:29:04.879Z (about 1 month ago)
- Language: JavaScript
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# parse-user-branch
[![npm version](https://img.shields.io/npm/v/parse-user-branch.svg)](https://www.npmjs.com/package/parse-user-branch)
[![Build Status](https://travis-ci.com/shinnn/parse-user-branch.svg?branch=master)](https://travis-ci.com/shinnn/parse-user-branch)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/parse-user-branch.svg)](https://coveralls.io/github/shinnn/parse-user-branch?branch=master)Parse a `username:branch` string that is available for [Github](https://github.com/) [commit comparison API](https://developer.github.com/v3/repos/commits/#compare-two-commits)
## Installation
[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/).
```
npm install parse-user-branch
```## API
```javascript
import parseUserBranch from 'parse-user-branch';
```### parseUserBranch(*str*)
*str*: `string` (`username:branch` style branch expression, for example → `'isaacs:dep-update'`)
Return: `Object` (`{username: ..., branch: ...}`)It extracts a username and a branch name from a `username:branch` string and creates an object.
```javascript
parseUserBranch('shinnn:patch-1');
//=> {username: 'shinnn', branch: 'patch-1'}
```## License
Copyright (c) 2016 - 2018 [Shinnosuke Watanabe](https://github.com/shinnn)
Licensed under [the MIT License](./LICENSE).