1.0.1-alpha.0 • Published 6 years ago
lub-api v1.0.1-alpha.0
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 } = require('lub-api');
const logger = log('scope');
logger.info('hello, world');
npm.installSync();
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
- 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.