npm

Share private packages across your team with npm Orgs, now with simplified billing via the aws marketplace!Learn more »

stringify-github-short-urls

2.0.0 • Public • Published

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

install

npm i stringify-github-short-urls

Downloadsweekly downloads

4

version

2.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability