# console-css

> console.log with css

Latest version **1.0.4** (published 2018-03-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install console-css
pnpm add console-css
yarn add console-css
bun add console-css
```

## 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.4 |
| Published | 2018-03-29 |
| First published | 2018-03-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 21 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | heroor |
| Maintainers | heroor |
| Keywords | console.css, console-css, console, css, style |

## Links

- npm: https://www.npmjs.com/package/console-css
- Repository: https://github.com/Heroor/console.css
- Homepage: https://github.com/Heroor/console.css#readme
- Issues: https://github.com/Heroor/console.css/issues
- npm.io page: https://npm.io/package/console-css

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2018-03-29
- 1.0.3 — 2018-03-26
- 1.0.2 — 2018-03-24
- 1.0.1 — 2018-03-24
- 1.0.0 — 2018-03-24

## README

# console.css
> Print text with CSS in browser

## Install

`npm i console-css -S`  
or  
`yarn add console-css`

## API

`console.css(options)`    

options: `string | Object | Array<options: Object>`  
1. String
2. Object
   - `text: string`
   - `style?: { [cssKey: string]: string | number }`
3. Array`<options: Object>`

## How to use?

```javascript
import 'console-css';

console.log('This is the console.log().');

console.css('This is the console.css(), you can use console.css like console.log:');
console.css(null);
console.css(undefined);
console.css(true, false);
console.css(1234, 567, 89);
```

```js
import 'console-css';

console.css({
  text: 'Can also be these:',
  style: {
    fontSize: '18px',
    color: '#d4a28e'
  }
});

console.css({
  text: 'hello world',
  style: {
    padding: '10px',
    lineHeight: '80px',
    fontSize: '50px',
    textShadow: '2px 2px 1px #999',
    background: '#eee',
    color: '#eee'
  }
});
```

```js
import 'console-css';

function showStatus(text, val) {
  var success = '#00a698';
  var error = '#ff7b71';
  return [{
    text: text,
    style: {
      padding: '2px 6px',
      fontSize: '8px',
      color: '#fff',
      background: '#555',
      borderRadius: '3px 0 0 3px'
    }
  }, {
    text: val ? 'success' : 'error',
    style: {
      padding: '2px 6px',
      fontSize: '8px',
      color: '#fff',
      background: val ? success : error,
      borderRadius: '0 3px 3px 0'
    }
  }]
}
console.css(showStatus('request', true));
console.css(showStatus('request', false));
```
![./images/1.png](./images/1.png)

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