verb
Version:
Verb makes it easy to build project documentation using simple markdown templates, with zero configuration required.
30 lines (23 loc) • 541 B
JavaScript
/**
* Verb <https://github.com/assemble/verb>
* Generate markdown documentation for GitHub projects.
*
* Copyright (c) 2014 Jon Schlinkert, Brian Woodward, contributors.
* Licensed under the MIT license.
*/
;
var url = require('url');
var _ = require('lodash');
/**
* Extract a username/org from a
* GitHub URL.
*
* @param {String}
* @return {String}
* @api public
*/
module.exports = function(str) {
var pathname = url.parse(str).pathname;
var name = _.compact(pathname.split('/'))[0];
return name;
};