finki-main
main
|
Last change
on this file since 81bc7da was 81bc7da, checked in by Klimentina Efremova <klimentina08642@…>, 3 months ago |
|
Initial commit
|
-
Property mode
set to
100644
|
|
File size:
895 bytes
|
| Line | |
|---|
| 1 | # github-from-package
|
|---|
| 2 |
|
|---|
| 3 | return the github url from a package.json file
|
|---|
| 4 |
|
|---|
| 5 | [](http://travis-ci.org/substack/github-from-package)
|
|---|
| 6 |
|
|---|
| 7 | # example
|
|---|
| 8 |
|
|---|
| 9 | For the `./package.json` file:
|
|---|
| 10 |
|
|---|
| 11 | ``` json
|
|---|
| 12 | {
|
|---|
| 13 | "name": "beep-boop",
|
|---|
| 14 | "version": "1.2.3",
|
|---|
| 15 | "repository" : {
|
|---|
| 16 | "type" : "git",
|
|---|
| 17 | "url": "git@github.com:substack/beep-boop.git"
|
|---|
| 18 | }
|
|---|
| 19 | }
|
|---|
| 20 | ```
|
|---|
| 21 |
|
|---|
| 22 | ``` js
|
|---|
| 23 | var github = require('github-from-package');
|
|---|
| 24 | var url = github(require('./package.json'));
|
|---|
| 25 | console.log(url);
|
|---|
| 26 | ```
|
|---|
| 27 |
|
|---|
| 28 | ```
|
|---|
| 29 | https://github.com/substack/beep-boop
|
|---|
| 30 | ```
|
|---|
| 31 |
|
|---|
| 32 | # methods
|
|---|
| 33 |
|
|---|
| 34 | ``` js
|
|---|
| 35 | var github = require('github-from-package')
|
|---|
| 36 | ```
|
|---|
| 37 |
|
|---|
| 38 | ## var url = github(pkg)
|
|---|
| 39 |
|
|---|
| 40 | Return the most likely github url from the package.json contents `pkg`. If no
|
|---|
| 41 | github url can be determined, return `undefined`.
|
|---|
| 42 |
|
|---|
| 43 | # install
|
|---|
| 44 |
|
|---|
| 45 | With [npm](https://npmjs.org) do:
|
|---|
| 46 |
|
|---|
| 47 | ```
|
|---|
| 48 | npm install github-from-package
|
|---|
| 49 | ```
|
|---|
| 50 |
|
|---|
| 51 | # license
|
|---|
| 52 |
|
|---|
| 53 | MIT
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.