0.0.1 • Published 2 years ago

colorslog-js v0.0.1

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

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)