Socket
Socket
Sign inDemoInstall

clrsole

Package Overview
Dependencies
3
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.1 to 4.0.0

dist/index.d.ts

85

package.json
{
"name": "clrsole",
"version": "3.0.1",
"description": "colorful console.log with custom appender",
"main": "index.js",
"directories": {
"lib": "lib",
"test": "test"
},
"scripts": {
"test": "jest --detectOpenHandles --config ./jest.config.js",
"example": "node ./examples/clrsole.js"
},
"repository": "https://github.com/fengxinming/logger/tree/master/packages/clrsole",
"keywords": [
"clrsole",
"console",
"logger",
"logging",
"log"
],
"author": "Jesse Feng",
"license": "MIT",
"bugs": {
"url": "https://github.com/fengxinming/logger/issues/issues"
},
"homepage": "https://github.com/fengxinming/logger/tree/master/packages/clrsole#readme",
"publishConfig": {
"main": "index.js"
},
"dependencies": {
"chalk": "^3.0.0",
"lodash": "^4.17.15",
"moment": "^2.24.0"
}
"name": "clrsole",
"description": "colorful console.log.",
"version": "4.0.0",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"scripts": {
"deps": "npm run clean && pnpm i",
"clean": "rm -rf node_modules",
"build": "vite build",
"test": "npm run build && node ./test/index.mjs",
"eslint": "eslint --ext .js,.mjs,.jsx,.ts,.tsx --fix --ignore-path .eslintignore ./",
"prepare": "husky",
"prepublishOnly": "npm run build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/fengxinming/clrsole.git"
},
"keywords": [
"console",
"log",
"color"
],
"author": "Jesse Feng <fxm0016@126.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/fengxinming/clrsole/issues"
},
"homepage": "https://github.com/fengxinming/clrsole#readme",
"dependencies": {
"base-log-factory": "^1.0.2",
"picocolors": "^1.0.0",
"tslib": "^2.6.2"
},
"devDependencies": {
"@commitlint/cli": "^19.2.0",
"@commitlint/config-conventional": "^19.1.0",
"@rollup/plugin-typescript": "^11.1.6",
"@types/node": "^20.12.7",
"eslint": "^8.57.0",
"eslint-config-fe": "^2.1.2",
"eslint-plugin-simple-import-sort": "^12.1.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"vite": "^5.2.9",
"vite-plugin-external": "^4.3.1"
},
"files": [
"dist"
]
}

38

README.md
# clrsole
[![npm package](https://nodei.co/npm/clrsole.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/clrsole)
> colorful console.log
[![NPM version](https://img.shields.io/npm/v/clrsole.svg?style=flat)](https://npmjs.org/package/clrsole)
[![NPM Downloads](https://img.shields.io/npm/dm/clrsole.svg?style=flat)](https://npmjs.org/package/clrsole)
## Usage
```javascript
import { getLogger, clrsole } from 'clrsole';
const { clrsole, getLogger } = require('clrsole');
const appLogger = getLogger('app');

@@ -21,33 +23,5 @@

// changed syslog levels
// appLogger.levels = require('graylog-sender/lib/syslog-levels');
appLogger.setLevels([
{ level: 'EMERGENCY', value: 0, color: 'magentaBright' },
{ level: 'ALERT', value: 1, color: 'magenta' },
{ level: 'CRITICAL', value: 2, color: 'redBright' },
{ level: 'ERROR', value: 3, color: 'red' },
{ level: 'WARN', value: 4, color: 'yellowBright' },
{ level: 'NOTICE', value: 5, color: 'yellow' },
{ level: 'INFO', value: 6, color: 'green' },
{ level: 'DEBUG', value: 7, color: 'cyan' }
], 'INFO');
// logging like syslog
appLogger.debug('message', 'message2');
appLogger.info('message', 'message2');
appLogger.notice('message', 'message2');
appLogger.warn('message', 'message2');
appLogger.error('message', 'message2');
appLogger.critical('message', 'message2');
appLogger.alert('message', 'message2');
appLogger.emergency('message', 'message2');
// The first param is level
appLogger.log('INFO', 'message', 'message2', ...);
appLogger.log('error', 'message', 'message2', ...);
appLogger.log('message', 'message2', ...);
clrsole.green('green message', ...);
clrsole.red('red message', ...);
```
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc