1.1.1 • Published 7 years ago
egg-colors v1.1.1
egg-colors
Install
$ npm i egg-colors --saveUsage
// {app_root}/config/plugin.js
exports.colors = {
enable: true,
package: 'egg-colors',
};Configuration
// {app_root}/config/config.default.js
exports.colors = {
};see config/config.default.js for more detail.
Example
# controller/home.js
'use strict';
const Controller = require('egg').Controller;
class HomeController extends Controller {
async index() {
const { ctx } = this;
await ctx.red('1111111111');
// await ctx.balck('123456');
// await ctx.red('123456');
// await ctx.green('123456');
// await ctx.yellow('123456');
// await ctx.blue('123456');
// await ctx.magenta('123456');
// await ctx.cyan('123456');
// await ctx.white('123456');
// await ctx.gray('123456');
// await ctx.grey('123456');
ctx.body = 'text';
}
}
module.exports = HomeController;Questions & Suggestions
Please open an issue here.