lub-api
An api collection of lub packages to export.
Install
npm install lub-api --save
Usage
lub-api
export a object with all utils of lubjs.
const log npm = ; const logger = ;logger; npm;
API
- command - A base command class to help develop your lub-plugin
- helper - contains some utils under lub-command
- fs - contains several useful file-system functions to help create your plugin
- copyTplSync(options) - copy dir or file and in the meantime replace template string (sync version)
- copyTpl(options, [, callback])- copy dir or file and in the meantime replace template string (async version)
- log - A log util to format your log outputs
- debug - debug log
- info - info log
- warn - warn log
- error - error log
- success - success log
- wait - wait log
- start - start log
- watch - watch log
- scope(name[, name]) - defines the scope name of the logger
- unscope - Clear the scope name of the logger
- config(setting) - defines the setting config of the logger
- npm - several useful utils to help operate npm bin
- findPackageJsonSync(startDir) => string - Find the closest package.json file, starting at process.cwd (by default) and working up to root.
- findPackageJson(startDir,callback) - async version of findPackageJsonSync
- installSync(pkgs,option) - install specific packages to pkg.json or install all dependencies from pkg.json
- install(pkgs,option,callback) - async version of installSync
- uninstallSync(pkgs,option) - uninstall specific packages
- uninstall(pkgs,option,callback) - async version of uninstall
- latest(pkg,option) - get the specific (default: latest) version pkg.json info of the package
PR Welcome
PRs are welcomed if you have useful utils during creating plugins.