@sky0014/logger
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

logger

A simple logger for js.

Install

npm install @sky0014/logger

Usage

import logger, { createLogger } from "@sky0014/logger";

// default logger, for most common use
logger.initLogger({
  enable: true,
  prefix: "easystore",
});

logger.log("hello there"); // [easystore] hello there

// isolated from default logger, for library use
const anotherLogger = createLogger();

anotherLogger.initLogger({
  enable: true,
  prefix: "another",
});

anotherLogger.log("hello there"); // [another] hello there

Publish

If your first time publish a package, login first:

npm login --registry=https://registry.npmjs.org

Then you can publish:

npm run pub

/@sky0014/logger/

    Package Sidebar

    Install

    npm i @sky0014/logger

    Weekly Downloads

    2

    Version

    1.0.8

    License

    none

    Unpacked Size

    7.41 kB

    Total Files

    7

    Last publish

    Collaborators

    • sky0014