0.0.10 β€’ Published 9 months ago

consolijs v0.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Consoli js

npm GitHub issues npm GitHub contributors GitHub license PRs Welcome GitHub Repo stars

Consoli is a new simple and fancy logger that help you even in production mode.

Features

  • β˜‘ Typescript.
  • ⭐️ tag property of logs.
  • πŸ‘ see logs even in production.
  • β˜„οΈ Colorize tags.

Installation

This module is distributed via npm which is bundled with node and should be installed as one of your project's dependencies:

npm i consolijs

🚨This package is standalone and have no any other dependacy.🚨

Usage

consoliClient.ts

import { Consoli } from "consoli";

export const consoli = new Consoli({

  nodeEnv: import.meta.env.MODE,
  secretKey: import.meta.env.VITE_CONSOLI,
  defaultDeveloperMode: ["SUCCESS"],
  tags: [{ displayName: "myTag", color: "#9f00a1" }],

});

main.ts

import { consoli } from "./consoliClient";

window.consoli = consoli; // for global usage
window.verbose = async () => {
  await consoli.verbose();
};

consoli.log("it a log consoli πŸ’ŽπŸ’Ž");
consoli.warn("it a warn consoli πŸ”ΆπŸ”Ά");
consoli.error("it a error consoli 🧯🧯");
consoli.success("it a success consoli πŸ”‹πŸ”‹");
consoli.tags?.myTag("it a my tag consoli πŸ‡πŸ‡");

global.d.ts

interface Window {
  verbose: () => Promise<void>;
  consoli: Consoli<"myTag">;
}

Usage in client

Press F12 , go to consol tab and write:

verbose()

And you see :

Avalilible Params

propertytypedescription
onMessageCallbackvoidcallback after get the message.
defaultDeveloperModeSUCCESS,INFO,WARN,ERRORdefault enabled options for developer mode.
tagsArray of Tags.

LICENSE

MIT

0.0.10

9 months ago

0.0.8

9 months ago

0.0.7

9 months ago

0.0.5

9 months ago

0.0.4

9 months ago