Closed TrySound closed 9 years ago
Actually it's not needed as option. It more part of "renaming", so ... and that's why I not implemented it in load-deps. And in second place, because that thing shouldn't be part of lib like this, it's user-specific and worth nothing to use separate libs like that
var appname = require('app-name')
var camelcase = require('camelcase')
var loadDeps = require('load-deps')
var strip = ['gulp', 'handlebars', 'helpers']
function rename (name) {
return camelcase(appname(name, strip))
}
var plugin = loadDeps('gulp-*', {renameKey: rename})
I think @TrySound is looking at it from a different perspective - e.g. as a user versus as an implementor. IMHO it makes sense to do what users expect here - and a user wouldn't want to do all of that work to get names to be camelcased. When implementors use this library in other node.js applications, they can still customize the renaming however they want.
@TrySound yeah if you want to do a pr to make it camelize by default, that would be great. @ianstormtaylor made a much better camelcase lib: to-camel-case
if you want to use that.
I'm a fan of the module pattern, to @tunnckoCore's point, so if you wanted to use app-name
there somehow that would be great too. thoughts?
e.g. as a user versus as an implementor
agreed. but yea, other than that performance hit shouldn't be an issue.
Why it false? Performace issue is not so important here. More comfortable to access all plugins out of the box without any brackets. Or maybe better combine both of them in one object?