[stringify-github-short-url][author-www-url] [![npmjs.com][npmjs-img]][npmjs-url] [![The MIT License][license-img]][license-url]

February 2, 2016 ยท View on GitHub

Generate Github / npm shorthand from list of arguments or object.

code climate standard code style travis build status coverage status dependency status

Install

npm i stringify-github-short-url --save

Usage

For more use-cases see the tests

const stringifyGithubShortUrl = require('stringify-github-short-url')

stringifyGithubShortUrl

Generate github / npm shorthand from list of arguments or object.

  • <owner> {String|Object} user or org string, or object
  • [name] {String} repo name
  • [branch] {String} branch name
  • [npm] {String} pass true if you want to generate npm shorthand
  • returns {String} generated shorthand

Example

const gh = require('stringify-github-short-url')

gh('jonschlinkert', 'micromatch')          // => 'jonschlinkert/micromatch'
gh('jonschlinkert', 'micromatch', 'dev')   // => 'jonschlinkert/micromatch#dev'
gh('gulpjs', 'gulp', 'v3.8.1', true)       // => 'gulpjs/gulp@v3.8.1'
gh({
  owner: 'tunnckoCore',
  name: 'parse-function'
}) // => 'tunnckoCore/parse-function'
gh({
  user: 'assemble',
  repo: 'assemble-core'
}) // => 'assemble/assemble-core'
  • apidocs-cli: Command-line app for generating API docs from code comments. Can be used as API of helper-apidocs package.
  • gitclone-cli: Git clone github repository with pattern like user/repo#branch
  • parse-github-short-url: Parse a github/npm shorthand (user/repo#branch or user/repo@version) URL into an object.
  • parse-github-url: Parse a github URL into an object.

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.

Charlike Make Reagent new message to charlike freenode #charlike

tunnckocore.tk keybase tunnckocore tunnckoCore npm tunnckoCore twitter tunnckoCore github