UNPKG

verb

Version:

A project without documentation is like a project that doesn't exist. Verb solves this by making it dead simple to generate docs, using simple markdown templates, with zero configuration required.

28 lines (22 loc) 530 B
/** * 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. */ const url = require('url'); const _ = 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; };