UNPKG

pkg-homepage

Version:

Get or create a homepage URL from the given package.json

79 lines (50 loc) 3.12 kB
# pkg-homepage [![NPM version](https://img.shields.io/npm/v/pkg-homepage.svg?style=flat)](https://www.npmjs.com/package/pkg-homepage) [![NPM downloads](https://img.shields.io/npm/dm/pkg-homepage.svg?style=flat)](https://npmjs.org/package/pkg-homepage) [![Build Status](https://img.shields.io/travis/jonschlinkert/pkg-homepage.svg?style=flat)](https://travis-ci.org/jonschlinkert/pkg-homepage) Get or create a homepage URL from the given package.json ## Install Install with [npm](https://www.npmjs.com/): ```sh $ npm install pkg-homepage --save ``` ## Usage ```js var homepage = require('pkg-homepage'); homepage({homepage: 'https://github.com/foo/bar'}); //=> 'https://github.com/foo/bar' homepage({repository: 'foo/bar'}); //=> 'https://github.com/foo/bar' homepage({repository: {url: 'git://gitub.com/foo/bar.git'}}); //=> 'https://github.com/foo/bar' ``` ## Related projects You might also be interested in these projects: * [git-branch](https://www.npmjs.com/package/git-branch): Get the current branch for a local git repository. | [homepage](https://github.com/jonschlinkert/git-branch) * [git-repo-name](https://www.npmjs.com/package/git-repo-name): Get the repository name from the git remote origin URL. | [homepage](https://github.com/jonschlinkert/git-repo-name) * [git-user-name](https://www.npmjs.com/package/git-user-name): Get a user's name from git config at the project or global scope, depending on… [more](https://www.npmjs.com/package/git-user-name) | [homepage](https://github.com/jonschlinkert/git-user-name) * [git-username](https://www.npmjs.com/package/git-username): Get the username from a git remote origin URL. | [homepage](https://github.com/jonschlinkert/git-username) * [parse-author](https://www.npmjs.com/package/parse-author): Parse a string into an object with `name`, `email` and `url` properties following npm conventions.… [more](https://www.npmjs.com/package/parse-author) | [homepage](https://github.com/jonschlinkert/parse-author) * [stringify-author](https://www.npmjs.com/package/stringify-author): Stringify an authors object to `name <email> (url)`. | [homepage](https://github.com/jonschlinkert/stringify-author) ## Contributing Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/pkg-homepage/issues/new). ## Building docs Generate readme and API documentation with [verb](https://github.com/verbose/verb): ```sh $ npm install verb && npm run docs ``` Or, if [verb](https://github.com/verbose/verb) is installed globally: ```sh $ verb ``` ## Running tests Install dev dependencies: ```sh $ npm install -d && npm test ``` ## Author **Jon Schlinkert** * [github/jonschlinkert](https://github.com/jonschlinkert) * [twitter/jonschlinkert](http://twitter.com/jonschlinkert) ## License Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). Released under the [MIT license](https://github.com/jonschlinkert/pkg-homepage/blob/master/LICENSE). *** _This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on April 27, 2016._