extract-github
Extract the Github project / repository URL from a given object
Last updated 12 years ago by V1 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install extract-github 
SYNC missed versions from official npm registry.

extract-github

Build Status

Extract a valid github URL from a given object. We make the assumption that the given object follows a package.json format as used by npm.

Installation

This module is released in the npm registry as extract-github and can therefor be installed using:

npm install --save extract-github

Usage

This module was written to only do specific task and do that task well, and that is extracting github information. We therefor export as a single function:

'use strict';

var extract = require('extract-github');

Once you've required the module you can feed it the contents of a package.json to extract to github information.

var github = extract(require('./package.json'));

The github variable should now contain an object with a user and repo property which can be re-used to create a new github URL. In addition to parsing package.json's it also supports extracting github information out of README it can do this by extracting Travis-CI badges or just plain ol matching github URL from the content.

var github = extract(require('fs').readFileSync(__dirname +'/README.md'));

License

MIT

Current Tags

  • 1.0.0                                ...           latest (10 years ago)

5 Versions

  • 1.0.0                                ...           10 years ago
  • 0.0.5                                ...           12 years ago
  • 0.0.3                                ...           12 years ago
  • 0.0.2                                ...           12 years ago
  • 0.0.1                                ...           12 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 2
Last Month 6
Dependencies (0)
None
Dev Dependencies (3)
Dependents (3)

Copyright 2013 - present © cnpmjs.org | Home |