JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 51
  • Score
    100M100P100Q60546F
  • License MIT

Package Exports

  • brush-log
  • brush-log/dist/esm/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (brush-log) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

brush-log

给控制台来点颜色

NPM version

安装

npm install brush-log --save

使用

import brush from 'brush-log'

console.log(...brush.black('对象', { a: 1 }))

或者

import { black } from 'brush-log'

console.log(...black('对象', { a: 1 }))

支持的颜色

  • black
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan

个性化

在项目入口文件中配置一次即可。

import brush from 'brush-log'

brush.setConfig({
  customText: true,
})
customText

Type: boolean

默认情况下,brush-log 会输出调用函数名,若要修改此行为,将 customText 设为 true,brush-log 将以输入的第一个参数作为输出。注意,此时第一个参数必须为字符串。