1 | # [stringify-github-short-url][author-www-url] [![npmjs.com][npmjs-img]][npmjs-url] [![The MIT License][license-img]][license-url]
|
2 |
|
3 | > Generate Github / npm shorthand from list of arguments or object.
|
4 |
|
5 | [![code climate][codeclimate-img]][codeclimate-url] [![standard code style][standard-img]][standard-url] [![travis build status][travis-img]][travis-url] [![coverage status][coveralls-img]][coveralls-url] [![dependency status][david-img]][david-url]
|
6 |
|
7 |
|
8 | ## Install
|
9 | ```
|
10 | npm i stringify-github-short-url --save
|
11 | ```
|
12 |
|
13 |
|
14 | ## Usage
|
15 | > For more use-cases see the [tests](./test.js)
|
16 |
|
17 | ```js
|
18 | const stringifyGithubShortUrl = require('stringify-github-short-url')
|
19 | ```
|
20 |
|
21 | ### [stringifyGithubShortUrl](./index.js#L40)
|
22 | > Generate github / npm shorthand from list of arguments or object.
|
23 |
|
24 | - `<owner>` **{String|Object}** user or org string, or object
|
25 | - `[name]` **{String}** repo name
|
26 | - `[branch]` **{String}** branch name
|
27 | - `[npm]` **{String}** pass `true` if you want to generate npm shorthand
|
28 | - `returns` **{String}** generated shorthand
|
29 |
|
30 | **Example**
|
31 |
|
32 | ```js
|
33 | const gh = require('stringify-github-short-url')
|
34 |
|
35 | gh('jonschlinkert', 'micromatch') // => 'jonschlinkert/micromatch'
|
36 | gh('jonschlinkert', 'micromatch', 'dev') // => 'jonschlinkert/micromatch#dev'
|
37 | gh('gulpjs', 'gulp', 'v3.8.1', true) // => 'gulpjs/gulp@v3.8.1'
|
38 | gh({
|
39 | owner: 'tunnckoCore',
|
40 | name: 'parse-function'
|
41 | }) // => 'tunnckoCore/parse-function'
|
42 | gh({
|
43 | user: 'assemble',
|
44 | repo: 'assemble-core'
|
45 | }) // => 'assemble/assemble-core'
|
46 | ```
|
47 |
|
48 |
|
49 | ## Related
|
50 | - [apidocs-cli](https://github.com/tunnckocore/apidocs-cli): Command-line app for generating API docs from code comments. Can be used as API of `helper-apidocs` package.
|
51 | - [gitclone-cli](https://github.com/tunnckocore/gitclone-cli): Git clone github repository with pattern like `user/repo#branch`
|
52 | - [parse-github-short-url](https://github.com/tunnckocore/parse-github-short-url): Parse a github/npm shorthand (user/repo#branch or user/repo@version) URL into an object.
|
53 | - [parse-github-url](https://github.com/jonschlinkert/parse-github-url): Parse a github URL into an object.
|
54 |
|
55 |
|
56 | ## Contributing
|
57 | Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/tunnckoCore/stringify-github-short-url/issues/new).
|
58 | But before doing anything, please read the [CONTRIBUTING.md](./CONTRIBUTING.md) guidelines.
|
59 |
|
60 |
|
61 | ## [Charlike Make Reagent](http://j.mp/1stW47C) [![new message to charlike][new-message-img]][new-message-url] [![freenode #charlike][freenode-img]][freenode-url]
|
62 |
|
63 | [![tunnckocore.tk][author-www-img]][author-www-url] [![keybase tunnckocore][keybase-img]][keybase-url] [![tunnckoCore npm][author-npm-img]][author-npm-url] [![tunnckoCore twitter][author-twitter-img]][author-twitter-url] [![tunnckoCore github][author-github-img]][author-github-url]
|
64 |
|
65 |
|
66 | [npmjs-url]: https://www.npmjs.com/package/stringify-github-short-url
|
67 | [npmjs-img]: https://img.shields.io/npm/v/stringify-github-short-url.svg?label=stringify-github-short-url
|
68 |
|
69 | [license-url]: https://github.com/tunnckoCore/stringify-github-short-url/blob/master/LICENSE
|
70 | [license-img]: https://img.shields.io/badge/license-MIT-blue.svg
|
71 |
|
72 |
|
73 | [codeclimate-url]: https://codeclimate.com/github/tunnckoCore/stringify-github-short-url
|
74 | [codeclimate-img]: https://img.shields.io/codeclimate/github/tunnckoCore/stringify-github-short-url.svg
|
75 |
|
76 | [travis-url]: https://travis-ci.org/tunnckoCore/stringify-github-short-url
|
77 | [travis-img]: https://img.shields.io/travis/tunnckoCore/stringify-github-short-url.svg
|
78 |
|
79 | [coveralls-url]: https://coveralls.io/r/tunnckoCore/stringify-github-short-url
|
80 | [coveralls-img]: https://img.shields.io/coveralls/tunnckoCore/stringify-github-short-url.svg
|
81 |
|
82 | [david-url]: https://david-dm.org/tunnckoCore/stringify-github-short-url
|
83 | [david-img]: https://img.shields.io/david/tunnckoCore/stringify-github-short-url.svg
|
84 |
|
85 | [standard-url]: https://github.com/feross/standard
|
86 | [standard-img]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg
|
87 |
|
88 |
|
89 | [author-www-url]: http://www.tunnckocore.tk
|
90 | [author-www-img]: https://img.shields.io/badge/www-tunnckocore.tk-fe7d37.svg
|
91 |
|
92 | [keybase-url]: https://keybase.io/tunnckocore
|
93 | [keybase-img]: https://img.shields.io/badge/keybase-tunnckocore-8a7967.svg
|
94 |
|
95 | [author-npm-url]: https://www.npmjs.com/~tunnckocore
|
96 | [author-npm-img]: https://img.shields.io/badge/npm-~tunnckocore-cb3837.svg
|
97 |
|
98 | [author-twitter-url]: https://twitter.com/tunnckoCore
|
99 | [author-twitter-img]: https://img.shields.io/badge/twitter-@tunnckoCore-55acee.svg
|
100 |
|
101 | [author-github-url]: https://github.com/tunnckoCore
|
102 | [author-github-img]: https://img.shields.io/badge/github-@tunnckoCore-4183c4.svg
|
103 |
|
104 | [freenode-url]: http://webchat.freenode.net/?channels=charlike
|
105 | [freenode-img]: https://img.shields.io/badge/freenode-%23charlike-5654a4.svg
|
106 |
|
107 | [new-message-url]: https://github.com/tunnckoCore/ama
|
108 | [new-message-img]: https://img.shields.io/badge/ask%20me-anything-green.svg |
\ | No newline at end of file |