node package manager


Some tiny tool functions.


Some tiny tool functions.

{String} the home path

split([])  =>  []
split('1,2,3') => [1, 2, 3]
split('1,,2,,3', ',,')  => [1, 2, 3]
camelcase('is-array')  =>  'isArray'
unCamelcase('isArray')  => 'is-array'

This function will create the dir first if necessary.

Remove specified dir or file. If the path is not existing, this function will do nothing.

This function will return an empty JSON object if any error occurs.

Mix properties form src to target.

Multiple src is ok, e.g: var target = mix(target, src1, src2, src3)

generateLine(4)  =>  '----'
generateLine(2, '=*')  =>  '=*=*'

Get options from parsed commander.

var commander = require('commander')
var cfg = cGetCfg(commander)

Return a function to generate help info for commander.

var commander = require('commander')
var pkg = require('../package')
commander.helpInfomation = cGetHelp(pkg)