stringify-github-short-urls
Stringify an array or object of github shorthand url objects returned from `parse-github-short-url(s)`
Last updated 6 years ago by tunnckocore .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install stringify-github-short-urls 
SYNC missed versions from official npm registry.

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

  • gitclone-cli: Git clone github repository with pattern like user/repo#branch
  • parse-function: Parse a function, arrow function or string to object with name, args, params and body properties.
  • 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.
  • stringify-github-short-url: Generate Github / npm shorthand from list of arguments or 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

Current Tags

  • 2.0.0                                ...           latest (5 years ago)

3 Versions

  • 2.0.0                                ...           5 years ago
  • 1.0.0                                ...           6 years ago
  • 0.0.0                                ...           6 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |