UNPKG

13 kBMarkdownView Raw
1# stringify-github-short-url [![npm version][npmv-img]][npmv-url] [![License][license-img]][license-url]
2
3> Generate Github / npm shorthand from list of arguments or object
4
5Please consider following this project's author, [Charlike Mike Reagent](https://github.com/tunnckoCore), and :star: the project to show your :heart: and support.
6
7<div id="readme"></div>
8
9[![Code style][codestyle-img]][codestyle-url]
10[![CircleCI linux build][linuxbuild-img]][linuxbuild-url]
11[![CodeCov coverage status][codecoverage-img]][codecoverage-url]
12[![DavidDM dependency status][dependencies-img]][dependencies-url]
13[![Renovate App Status][renovateapp-img]][renovateapp-url]
14[![Time Since Last Commit][last-commit-img]][last-commit-url]
15[![Make A Pull Request][prs-welcome-img]][prs-welcome-url]
16
17<!-- [![Semantically Released][standard-release-img]][standard-release-url] -->
18
19If you have any _how-to_ kind of questions, please read the [Contributing Guide][contributing-url] and [Code of Conduct][code_of_conduct-url] documents.
20For bugs reports and feature requests, [please create an issue][open-issue-url] or ping
21[@tunnckoCore](https://twitter.com/tunnckoCore) at Twitter.
22
23[![Conventional Commits][ccommits-img]][ccommits-url]
24[![Minimum Required Nodejs][nodejs-img]][npmv-url]
25[![NPM Downloads Monthly][downloads-monthly-img]][npmv-url]
26[![NPM Downloads Total][downloads-total-img]][npmv-url]
27[![Share Love Tweet][twitter-share-img]][twitter-share-url]
28[![Twitter][twitter-img]][twitter-url]
29
30Project is [semantically](https://semver.org) versioned & automatically released from [GitHub Actions](https://github.com/features/actions) with [Lerna](https://github.com/lerna/lerna).
31
32[![Become a Patron][patreon-img]][patreon-url]
33[![Buy me a Kofi][kofi-img]][kofi-url]
34[![PayPal Donation][paypal-img]][paypal-url]
35[![Bitcoin Coinbase][bitcoin-img]][bitcoin-url]
36[![Keybase PGP][keybase-img]][keybase-url]
37
38| Topic | Contact |
39| :--------------------------------------------------------------- | ------------------------------------------------: |
40| Any legal or licensing questions, like private or commerical use | ![tunnckocore_legal][tunnckocore_legal] |
41| For any critical problems and security reports | ![tunnckocore_security][tunnckocore_security] |
42| Consulting, professional support, personal or team training | ![tunnckocore_consulting][tunnckocore_consulting] |
43| For any questions about Open Source, partnerships and sponsoring | ![tunnckocore_opensource][tunnckocore_opensource] |
44
45<!-- Logo when needed:
46
47<p align="center">
48 <a href="https://github.com/tunnckoCore/opensource">
49 <img src="./media/logo.png" width="85%">
50 </a>
51</p>
52
53-->
54
55## Table of Contents
56
57- [Install](#install)
58- [API](#api)
59 - [stringifyGithubShortUrl](#stringifygithubshorturl)
60- [Contributing](#contributing)
61 - [Guides and Community](#guides-and-community)
62 - [Support the project](#support-the-project)
63 - [OPEN Open Source](#open-open-source)
64 - [Wonderful Contributors](#wonderful-contributors)
65- [License](#license)
66
67_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_
68
69## Install
70
71This project requires [**Node.js**](https://nodejs.org) **>=10.13** _(see [Support & Release Policy](https://github.com/tunnckoCoreLabs/support-release-policy))_. Install it using
72[**yarn**](https://yarnpkg.com) or [**npm**](https://npmjs.com).<br>
73_We highly recommend to use Yarn when you think to contribute to this project._
74
75```bash
76$ yarn add stringify-github-short-url
77```
78
79<!-- docks-start -->
80
81## API
82
83_Generated using [jest-runner-docs](https://npmjs.com/package/jest-runner-docs)._
84
85### [stringifyGithubShortUrl](./src/index.js#L30)
86
87Generate github / npm shorthand from list
88of arguments or object.
89
90**Signature**
91
92```ts
93function(owner, name, branch, npm)
94```
95
96**Params**
97
98- `<owner>` - user or org string, or object
99- `[name]` - repo name
100- `[branch]` - branch name
101- `[npm]` - pass `true` if you want to generate npm shorthand
102- `returns` - generated shorthand
103
104**Example**
105
106```js
107import stringify from 'stringify-github-short-url';
108
109stringify('jonschlinkert', 'micromatch'); // => 'jonschlinkert/micromatch'
110stringify('jonschlinkert', 'micromatch', 'dev'); // => 'jonschlinkert/micromatch#dev'
111stringify('gulpjs', 'gulp', 'v3.8.1', true); // => 'gulpjs/gulp@v3.8.1'
112stringify({
113 owner: 'tunnckoCore',
114 name: 'parse-function',
115}); // => 'tunnckoCore/parse-function'
116stringify({
117 user: 'assemble',
118 repo: 'assemble-core',
119}); // => 'assemble/assemble-core'
120```
121
122<!-- docks-end -->
123
124**[back to top](#readme)**
125
126## Contributing
127
128### Guides and Community
129
130Please read the [Contributing Guide][contributing-url] and [Code of Conduct][code_of_conduct-url] documents for advices.
131
132For bug reports and feature requests, please join our [community][community-url] forum and open a thread there with prefixing the title of the thread with the name of the project if there's no separate channel for it.
133
134Consider reading the [Support and Release Policy](https://github.com/tunnckoCoreLabs/support-release-policy) guide if you are interested in what are the supported Node.js versions and how we proceed. In short, we support latest two even-numbered Node.js release lines.
135
136### Support the project
137
138[Become a Partner or Sponsor?][patreon-url] :dollar: Check the **Partner**, **Sponsor** or **Omega-level** tiers! :tada: You can get your company logo, link & name on this file. It's also rendered on package page in [npmjs.com][npmv-url] and [yarnpkg.com](https://yarnpkg.com/en/package/stringify-github-short-url) sites too! :rocket:
139
140Not financial support? Okey! [Pull requests](https://github.com/tunnckoCoreLabs/contributing#opening-a-pull-request), stars and all kind of [contributions](https://opensource.guide/how-to-contribute/#what-it-means-to-contribute) are always
141welcome. :sparkles:
142
143<!--
144### OPEN Open Source
145
146This project is following [OPEN Open Source](http://openopensource.org) model
147
148> Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is built on collective efforts and it's not strongly guarded by its founders.
149
150There are a few basic ground-rules for its contributors
151
1521. Any **significant modifications** must be subject to a pull request to get feedback from other contributors.
1532. [Pull requests](https://github.com/tunnckoCoreLabs/contributing#opening-a-pull-request) to get feedback are _encouraged_ for any other trivial contributions, but are not required.
1543. Contributors should attempt to adhere to the prevailing code-style and development workflow.
155-->
156
157### Wonderful Contributors
158
159Thanks to the hard work of these wonderful people this project is alive! It follows the
160[all-contributors](https://github.com/kentcdodds/all-contributors) specification.
161Don't hesitate to add yourself to that list if you have made any contribution! ;) [See how,
162here](https://github.com/jfmengels/all-contributors-cli#usage).
163
164<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
165<!-- prettier-ignore -->
166| [<img src="https://avatars3.githubusercontent.com/u/5038030?v=4" width="120px;"/><br /><sub><b>Charlike Mike Reagent</b></sub>](https://tunnckocore.com)<br />[💻](https://github.com/tunnckoCore/opensource/commits?author=tunnckoCore "Code") [📖](https://github.com/tunnckoCore/opensource/commits?author=tunnckoCore "Documentation") [💬](#question-tunnckoCore "Answering Questions") [👀](#review-tunnckoCore "Reviewed Pull Requests") [🔍](#fundingFinding-tunnckoCore "Funding Finding") |
167| :---: |
168
169<!-- ALL-CONTRIBUTORS-LIST:END -->
170
171Consider showing your [support](#support-the-project) to them. :sparkling_heart:
172
173**[back to top](#readme)**
174
175## License
176
177Copyright (c) 2015-present, [Charlike Mike Reagent](https://tunnckocore.com) `<opensource@tunnckocore.com>` & [contributors](#wonderful-contributors).<br>
178Released under the [MPL-2.0 License][license-url].
179
180[contributing-url]: https://github.com/tunnckoCore/opensource/blob/master/CONTRIBUTING.md
181[code_of_conduct-url]: https://github.com/tunnckoCore/opensource/blob/master/CODE_OF_CONDUCT.md
182
183<!-- Heading badges -->
184
185[npmv-url]: https://www.npmjs.com/package/stringify-github-short-url
186[npmv-img]: https://badgen.net/npm/v/stringify-github-short-url?icon=npm
187[nodejs-img]: https://badgen.net/npm/node/stringify-github-short-url
188
189<!--
190[ghrelease-url]: https://github.com/tunnckoCore/opensource/releases/latest
191[ghrelease-img]: https://badgen.net/github/release/tunnckoCore/opensource?icon=github
192-->
193
194[license-url]: https://github.com/tunnckoCore/opensource/blob/master/packages/stringify-github-short-url/LICENSE
195[license-img]: https://badgen.net/npm/license/stringify-github-short-url
196
197<!-- Front line badges -->
198
199[codestyle-url]: https://github.com/airbnb/javascript
200[codestyle-img]: https://badgen.net/badge/code%20style/airbnb/ff5a5f?icon=airbnb
201[linuxbuild-url]: https://github.com/tunnckocore/opensource/actions
202[linuxbuild-img]: https://badgennet.charlike-oss.now.sh/github/checks/tunnckoCore/opensource/master?label=build&icon=github
203[codecoverage-url]: https://codecov.io/gh/tunnckoCore/opensource
204[codecoverage-img]: https://badgen.net/codecov/c/github/tunnckoCore/opensource?icon=codecov
205[dependencies-url]: https://david-dm.org/tunnckoCore/opensource
206[dependencies-img]: https://badgen.net/david/dep/tunnckoCore/opensource?label=deps
207[ccommits-url]: https://conventionalcommits.org/
208[ccommits-img]: https://badgen.net/badge/conventional%20commits/v1.0.0/green
209[standard-release-url]: https://github.com/standard-release/standard-release
210[standard-release-img]: https://badgen.net/badge/semantically/released/05c5ff
211[community-img]: https://badgen.net/badge/join/community/7b16ff
212[community-url]: https://github.com/tunnckocorehq/community
213[last-commit-img]: https://badgen.net/github/last-commit/tunnckoCore/opensource/master
214[last-commit-url]: https://github.com/tunnckoCore/opensource/commits/master
215[downloads-weekly-img]: https://badgen.net/npm/dw/stringify-github-short-url?icon=npm
216[downloads-monthly-img]: https://badgen.net/npm/dm/stringify-github-short-url?icon=npm
217[downloads-total-img]: https://badgen.net/npm/dt/stringify-github-short-url?icon=npm
218[renovateapp-url]: https://renovatebot.com
219[renovateapp-img]: https://badgen.net/badge/renovate/enabled/green
220[prs-welcome-img]: https://badgen.net/badge/PRs/welcome/green
221[prs-welcome-url]: http://makeapullrequest.com
222
223<!-- TODO: update icon -->
224
225[paypal-url]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HYJJEZNSGAPGC&source=url
226[paypal-img]: https://badgen.net/badge/PayPal/donate/003087?icon=https://simpleicons.now.sh/paypal/fff
227
228<!-- TODO: update icon -->
229
230[kofi-url]: https://ko-fi.com/tunnckoCore
231[kofi-img]: https://badgen.net/badge/Buy%20me/a%20coffee/29abe0c2?icon=https://rawcdn.githack.com/tunnckoCore/badgen-icons/f8264c6414e0bec449dd86f2241d50a9b89a1203/icons/kofi.svg
232
233<!-- TODO: update icon -->
234
235[bitcoin-url]: https://www.blockchain.com/btc/payment_request?address=3QNHKun1K1SUui1b4Z3KEGPPsWC1TgtnqA&message=Open+Source+Software&amount_local=10&currency=USD
236[bitcoin-img]: https://badgen.net/badge/Bitcoin%20tip/3QNHKun...b4Z3KEGPPsWC1TgtnqA/yellow?icon=https://simpleicons.now.sh/bitcoin/fff
237[keybase-url]: https://keybase.io/tunnckoCore
238[keybase-img]: https://badgen.net/keybase/pgp/tunnckoCore
239[twitter-url]: https://twitter.com/tunnckoCore
240[twitter-img]: https://badgen.net/twitter/follow/tunnckoCore?icon=twitter&color=1da1f2
241[patreon-url]: https://www.patreon.com/bePatron?u=5579781
242[patreon-img]: https://badgen.net/badge/Become/a%20patron/F96854?icon=patreon
243
244<!-- [patreon-img]: https://badgen.net/badge/Patreon/tunnckoCore/F96854?icon=patreon -->
245
246[patreon-sponsor-img]: https://badgen.net/badge/become/a%20sponsor/F96854?icon=patreon
247[twitter-share-url]: https://twitter.com/intent/tweet?text=https://github.com/tunnckoCore/opensource&via=tunnckoCore
248[twitter-share-img]: https://badgen.net/badge/twitter/share/1da1f2?icon=twitter
249[open-issue-url]: https://github.com/tunnckoCore/opensource/issues/new
250[tunnckocore_legal]: https://badgen.net/https/liam-badge-daknys6gadky.runkit.sh/com/legal/tunnckocore?label&color=A56016&icon=https://svgshare.com/i/Dt6.svg
251[tunnckocore_consulting]: https://badgen.net/https/liam-badge-daknys6gadky.runkit.sh/com/consulting/tunnckocore?label&color=07ba96&icon=https://svgshare.com/i/Dt6.svg
252[tunnckocore_security]: https://badgen.net/https/liam-badge-daknys6gadky.runkit.sh/com/security/tunnckocore?label&color=ed1848&icon=https://svgshare.com/i/Dt6.svg
253[tunnckocore_opensource]: https://badgen.net/https/liam-badge-daknys6gadky.runkit.sh/com/opensource/tunnckocore?label&color=ff7a2f&icon=https://svgshare.com/i/Dt6.svg
254[tunnckocore_newsletter]: https://badgen.net/https/liam-badge-daknys6gadky.runkit.sh/com/newsletter/tunnckocore?label&color=5199FF&icon=https://svgshare.com/i/Dt6.svg