Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinnn/parse-user-repo
Parse a username/repo string
https://github.com/shinnn/parse-user-repo
Last synced: 27 days ago
JSON representation
Parse a username/repo string
- Host: GitHub
- URL: https://github.com/shinnn/parse-user-repo
- Owner: shinnn
- License: isc
- Created: 2015-12-28T12:04:49.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-12-22T05:57:27.000Z (almost 6 years ago)
- Last Synced: 2024-10-13T07:06:20.881Z (about 1 month ago)
- Language: JavaScript
- Homepage: https://tonicdev.com/npm/parse-user-repo
- Size: 57.6 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-repo
[![npm version](https://img.shields.io/npm/v/parse-user-repo.svg)](https://www.npmjs.com/package/parse-user-repo)
[![Build Status](https://travis-ci.com/shinnn/parse-user-repo.svg?branch=master)](https://travis-ci.com/shinnn/parse-user-repo)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/parse-user-repo.svg)](https://coveralls.io/github/shinnn/parse-user-repo?branch=master)Parse a `username/repo` string
## Installation
[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/).
```
npm install parse-user-repo
```## API
```javascript
import parseUserRepo from 'parse-user-repo';
```### parseUserRepo(*str*)
*str*: `string` (`user/repo` style repository identifier, for example → `'holman/spark'`)
Return: `Object` (`{username: ..., repo: ...}`)It extracts a username and a repository name from a `user/repo` string and creates an `Object`.
```javascript
parseUserRepo('gohugoio/hugo'); //=> {username: 'gohugoio', repo: 'hugo'}
```## License
[ISC License](./LICENSE) © 2018 Shinnosuke Watanabe