GitXplorerGitXplorer
q

lac

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
cfbbeba956ac9ac262340610ac7d7aad392b24a3

high intensity color 的标志由 ! 更新为 %

qqiu8310 committed 9 years ago
Unverified
0b9c0bcf47723235752f88a7b856744d08f800be

修正无法 end bold 的问题

qqiu8310 committed 9 years ago
Unverified
aa303e09c537679f1696a57a0df1ced0eab894db

使用 supports-color 模块

qqiu8310 committed 9 years ago
Unverified
45bd61fe1d385fc1192cc3b18265c8354d069151

补充一个编译的版本

qqiu8310 committed 9 years ago
Unverified
f97292ef82a8d3ff8d083e424d5a5a7d1864115f

fix no-color bug

qqiu8310 committed 9 years ago
Unverified
622f50841a2152cdd9dc7e591e288b0d75c92c31

Release 0.0.3

qqiu8310 committed 9 years ago

README

The README file for this repository.

lac

log and color

INSTALL

npm install lac

USAGE

import {color, log, slog, logDeep, logd} from lac;

color('the string', '!red.-green'); // "!" => high intensity color; "-" => background color
log('^%s cyan color^', 'some text');  // "^...^" => cyan, only parse first paramater's markdown tag
logDeep('^%s color^', '**bold**'); // parse all paramaters markdown tag
// logd is an alias of logDeep

let cyanStr = slog('^str^');  // return colored string, not output;

CUSTOM

import {COLOR, MARKDOWN} from lac;

COLOR.darkgreen = '006400';
color('my custom color', 'darkgreen');

MARKDOWN.$ = '006400';
log('$my custom markdown$');

DEFAULTS

// COLOR
COLOR = {
  brown: 'A52A2A',
  chocolate: 'D2691E',
  ghostwhite: 'F8F8FF',
  gold: 'FFD700',
  navy: '000080',
  olive: '808000',
  orange: 'FFA500',
  orangered: 'FF4500',
  pink: 'FFC0CB',
  purple: '800080',
  seagreen: '2E8B57',
  silver: 'C0C0C0',
  skyblue: '87CEEB',
  yellowgreen: '9ACD32'
}

// MARKDOWN
MARKDOWN = {
  '**': 'bold',
  '*': 'gray',
  '`': 'red.-white',
  '__': 'underline',
  '_': 'italic',
  '!': 'yellow',
  '#': 'red',
  '@': 'blue',
  '&': 'green',
  '^': 'cyan',
  '~': 'magenta'
}