require-package-name
Gets the base package name for a module path in a require statement. Assumes the path is not relative.
var name = //get the module name for a require path 'events' 'events' 'events' '@username/button' '@username/foo' //or, get the base name excluding any scopename 'button'name 'foo'
Usage
name = packageName(str)
Gets the name of a module for a require string like 'xtend'
from 'xtend/mutable.js'
.
base = packageName.base(str)
Gets the base name of a module. This is the same as above, except it excludes scoped usernames.
License
MIT, see LICENSE.md for details.