npm.io
0.0.1 • Published 4 years ago

colorslog-js

Licence
Version
0.0.1
Deps
0
Size
6 kB
Vulns
0
Weekly
0

colors-log

colors-log is a simple library for console.log colors.

Installation

npm install colorslog-js

Usage

With JS:

import useLogger from 'colorslog-js';

// in root files
useLogger();

// in components
console.print('hello world');
console.print('hello world', {}, 'success');
console.print('hello world', {
  scheme: {
    backgroundColor: '#fdf1f0',
    color: '#ef361a',
  }
});

With Vue.js:

// main.ts
import {printPlugin} from 'colorslog-js';

Vue.use(printPlugin);

const instance = getCurrentInstance();
const $print = instance?.appContext.config.globalProperties.$print

// or
console.pint('hello world');

// Note: `$print` is a global property.
Features under development...

(Not for use in production line environments)

Keywords