Skip to content

Commit

Permalink
Merge pull request #5630 from nestjs/feat/remove-cli-color
Browse files Browse the repository at this point in the history
feat(common): remove cli-color dependency
  • Loading branch information
kamilmysliwiec committed Oct 30, 2020
2 parents da13cca + b8a52cc commit 5e3c88a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 0 additions & 1 deletion packages/common/package.json
Expand Up @@ -18,7 +18,6 @@
"license": "MIT",
"dependencies": {
"axios": "0.20.0",
"cli-color": "2.0.0",
"iterare": "1.2.1",
"tslib": "2.0.3",
"uuid": "8.3.1"
Expand Down
3 changes: 1 addition & 2 deletions packages/common/services/logger.service.ts
@@ -1,10 +1,9 @@
import * as clc from 'cli-color';
import { Injectable } from '../decorators/core/injectable.decorator';
import { Optional } from '../decorators/core/optional.decorator';
import { clc, yellow } from '../utils/cli-colors.util';
import { isObject } from '../utils/shared.utils';

declare const process: any;
const yellow = clc.xterm(3);

export type LogLevel = 'log' | 'error' | 'warn' | 'debug' | 'verbose';

Expand Down
8 changes: 8 additions & 0 deletions packages/common/utils/cli-colors.util.ts
@@ -0,0 +1,8 @@
export const clc = {
green: (text: string) => `\x1B[32m${text}\x1B[39m`,
yellow: (text: string) => `\x1B[33m${text}\x1B[39m`,
red: (text: string) => `\x1B[31m${text}\x1B[39m`,
magentaBright: (text: string) => `\x1B[95m${text}\x1B[39m`,
cyanBright: (text: string) => `\x1B[96m${text}\x1B[39m`,
};
export const yellow = (text: string) => `\x1B[38;5;3m${text}\x1B[39m`;

0 comments on commit 5e3c88a

Please sign in to comment.