npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

color7log

v1.6.11

Published

a simple log only with color

Downloads

20

Readme

1、简介

设置node中console.log的输出文字颜色, 输出日志文件 7的意思是&键盘符

2、使用说明

npm install color7log
    const {green} = require('color7log')

    const {black, red, green, yellow, blue, purple, cyan, white,
    gray} = require('color7log') // 支持多个参数 demo如下

    const theme = require('color7log') // theme.green('这里输入绿色文本')
    black('输出黑色文本', '多参数')
    red('输出红色文本', '多参数', 8)
    green('输出绿色文本')
    yellow('输出黄色文本')
    blue('输出蓝色文本')
    purple('输出紫色/酒红色文本')
    cyan('输出蓝绿色文本')
    white('输出白色文本')
    gray('输出灰色文本')

    theme.red('这个是红色的')
    ...

Image text

#### 1)定义输出多个颜色
    const {custom} = require('color7log')
    custom({cyan:'浅蓝色',red:'组合红', green:'组合绿'}) // 支持多个组合输出

Image text

#### 2)默认以字符'-'分隔每个参数 每个颜色方法后加F 例如
    const {greenF} = require('color7log')
    greenF('参数1', '参数2', '参数3') // 将以多个'-'符号作为分割线输出内容

Image text

#### 3)自定义格式化字符 每个颜色方法后加Fmt 最后一个参数必须是格式化字符
    const {greenFmt} = require('color7log')

    // 将以多个'='符号作为分割线分别输出内容
    greenFmt('参数1', '参数2', '参数3', '=')

Image text

#### 4)自动选择颜色函数 依次从'red', 'green', 'yellow', 'blue', 'purple'
, 'cyan','white', 'gray'选取颜色, 分隔符'-'
    const {autoC} = require('color7log')
    autoC('参数1', '参数2', '参数3') // 会依次输出 红色,绿色,黄色

Image text

#### 5)日志文件方法 默认在根目录下的log目录中按日期记录文件
    const {printFile} = require('color7log')
    printFile('测试效果') // 会在/log/2020-9-11.txt中记录内容
(个人感觉一般的系统没必要像log4js那样记录复杂的日志,认知有限,还在成长)

如果命令窗或者bash工具窗(如git bash)中输出文字乱码,
请在对应工具的选项的子菜单中 修改text设置为cn utf8
有问题欢迎反馈 [email protected]

git地址 https://github.com/vsionly/color7log

1、abstract

Make some settings only for the output text color of console.log

2、instuctment

npm install color7log
    const {green} = require('color7log') // use one fun
    const {black, red, green, yellow, blue, purple, cyan, white,
           gray} = require('color7log')
     // Support multiple parameters

    const theme = require('color7log') // theme.green('this text is green')
    red('red 1', 'red 2', 'red 1')

1) Add multi-color settings

    const {custom} = require('color7log')
    custom({cyan:'this text color is cyan', red:'this text color is red' ,
        green:'this text color is green'})

2) Add the default formatting character '-' to each method followed by F

    Const {redF} = require('color7log')    
    redF ('output gray text') // will output content with multiple '-' symbols
    // as split lines

3) New You can define formatting characters. Add Fmt after each color method.

    Const {redFmt} = require('color7log')

    // will output content with multiple '=' symbols as split lines
    redFmt ('output gray text', '=')

4) Automatically select color function Select colors from'red','green','yellow','blue',

'purple','cyan','white', and'gray' in sequence

    const {autoC} = require('color7log')
    autoC(1, 2, 3) // will output red, green and yellow in turn

5) the log file method logs files by date in the log directory under the root directory

    const {printFile} = require('color7log')
    printFile('test effect') // will record the content in /log/2020-9-11.txt
(Personally, I feel that the general system does not need to record
complex logs like log4js, the knowledge is limited and itis still growing)

If the input text is garbled in the command window or git bash,
modify the encoding of the command tool to your own standard encoding.
If you have any questions, please send a message to [email protected]

git https://github.com/vsionly/color7log