2.0.0 • Published 8 years ago

stringify-github-short-urls v2.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

stringify-github-short-urls npmjs.com The MIT License

Stringify array of parse-github-short-url objects to shorthand.

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

Install

npm i stringify-github-short-urls --save

Usage

For more use-cases see the tests

const stringifyGithubShortUrls = require('stringify-github-short-urls')

stringifyGithubShortUrls

Stringify object or list of arguments to Github / npm shorthand.

Params

  • <owner> {Array|String|Object}: user or org string, or object, array of objects
  • [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-urls')

// same as `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']

// or accept arrays of objects that are passed to `stringify-github-short-url`
gh([
  {owner: 'assemble', name: 'assemble-core'},
  {owner: 'jonschlinkert', name: 'micromatch', branch: 'dev'}
]) // => ['assemble/assemble-core', 'jonschlinkert/micromatch#dev']

Related

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