# logdecor

> This library is just for all JS lovers out there to see the logs in style

Latest version **1.0.2** (published 2019-07-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install logdecor
pnpm add logdecor
yarn add logdecor
bun add logdecor
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2019-07-17 |
| First published | 2019-07-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 311.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| Author | Anooj Krishnan G |
| Maintainers | anoojkrishnan |
| Keywords | log, color, stylelog, loginstyle, styleinlog, style, logstyling, colouredlog, logcolor, colorinlog, chromelog, colorchrome, chromelog |

## Links

- npm: https://www.npmjs.com/package/logdecor
- Repository: https://github.com/anooj1483/stylelog
- Homepage: https://github.com/anooj1483/stylelog#readme
- Issues: https://github.com/anooj1483/stylelog/issues
- npm.io page: https://npm.io/package/logdecor

## Dependencies (2)

- [chalk](https://npm.io/package/chalk.md) ^2.4.2
- [figlet](https://npm.io/package/figlet.md) ^1.2.3

## Alternatives

- [postcss-color-hex-alpha](https://npm.io/package/postcss-color-hex-alpha.md) — 6.4M weekly downloads
- [randomcolor](https://npm.io/package/randomcolor.md) — 348.0K weekly downloads
- [bows](https://npm.io/package/bows.md) — 1.3K weekly downloads
- [ep_prefer_color_scheme](https://npm.io/package/ep_prefer_color_scheme.md) — 260 weekly downloads
- [coc-yank](https://npm.io/package/coc-yank.md) — 61 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2019-07-17
- 1.0.1 — 2019-07-16
- 1.0.0 — 2019-07-16

## README

![](https://raw.githubusercontent.com/anooj1483/stylelog/master/demo/stylelog.png)

![](https://img.shields.io/github/size/anooj1483/stylelog/stylelog.js.svg?style=popout) ![](https://img.shields.io/github/package-json/v/anooj1483/stylelog.svg?style=popout) ![](https://img.shields.io/github/issues/anooj1483/stylelog.svg?style=popout)



This library is just for all JS lovers out there to see the logs in style. 
All React-Native developers, try this on your debugger

**Installation**

`$ npm install logdecor`

**Usage**

Import stylelog

    import $ from 'logdecor'
    


**Available Methods**

$.log()
Parameters: text ,color-code
```javascript
	$.log("Log this text") //Simply logs the content
	$.log("Log this text","#00bcd4") //Logs it in specific color code
	
```

------------


$.logAll()
Last argument must be a color code (optional)
```javascript
	$.logAll("Log this text",{name:"Sync"},$.color.chocolate) 
	//Logs the text in chocolate color and logs the rest of the elements
	
```

------------


$.logTitle()
Displays the text in stylelog logo style
```javascript
	$.logTitle('stylelog');
	//Logs the text in styleog logo style
	
```
![](https://raw.githubusercontent.com/anooj1483/stylelog/master/demo/stylelog.png)

------------

$.logLego()
Displays the text in stylelog logo style but in custom color
```javascript
	$.logLego("DEV","#d91f26","#d91f26","#a622ab");
	//Logs the text in styleog logo style (custom color)
	
```

------------

$.logImage()
Displays the image in log. It supports both PNG, JPEG & GIF

```javascript
	$.logImage("http://domain.com/img.png");
	//Displays the image in chrome console
	$.logImage("Show Text","http://domain.com/img.png");
	//Pass text as optional
	
```

![](https://raw.githubusercontent.com/anooj1483/stylelog/master/demo/logimg.png)


------------

$.logInStyle()
Pass the text to display and CSS Style
```javascript
	$.logInStyle("text to display","font-size: 50px;color:'#00bcd4'");
	//This will show the text in given style
	
```

------------



$.logTable()
Displays the JS object & array in table format
```javascript
	$.logTable([{name:"Anooj",department:"Mobile"},{name:"Sarthak",department:"R & D"},{name:"Jyothi",department:"Mobile"}])
	
```

![](https://raw.githubusercontent.com/anooj1483/stylelog/master/demo/logtable.png)


------------


$.logObjectJSON()
Converts object to JSON string and logs it in style

```javascript
	$.logObjectJSON({j:'kk',l:'ku'},$.color.rebeccapurple);
	//Displays the stringified version of object in console
	
```

------------

$.logJSONObject()
Converts JSON string to object and logs it

```javascript
	$.logObjectJSON({"j":"kk","l":"ku"});
	//Displays the parsed version of json string in console
	
```

------------

$.logObjectKeys()
Displays all keys in an object
```javascript
	$.logObjectKeys({"j":"kk","l":"ku"});
	//Displays the array of keys in console
	//["j","l"]
	
```

------------

$.flipObject()
Flips keys to values & values to keys
```javascript
	$.flipObject({"j":"kk","l":"ku"});
	//Displays the array of keys in console
	//{"kk":"j","ku":"l"}
	
```

------------

---
_Source: https://npm.io/package/logdecor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
