@ntf/logger
v1.0.2
Published
Another console logger library
Downloads
1
Maintainers
Readme
@ntf/logger
Another console logger library
Why
Because I like reinventing the wheel :)
Installation
Use your favourite package manager, idk
npm install @ntf/logger
yarn add @ntf/logger
pnpm install @ntf/logger
Usage
Importing
This library can be used in CommonJS
and ESModule
environments
const { ... } = require("@ntf/logger");
import { ... } from "@ntf/logger";
For NodeJS
For NodeJS there's AnsiLogger
class which you can guess, uses escaped ansi code for colors in termnial/console/command prompt/whatever terminal name
For Browser
For Browser there's CSSLogger
class which uses the cool feature of CSS styling, you can try AnsiLogger
but on some browsers it looks weird (especially Chrome)
I want to make my own Logger
Just extend the Logger
class and implement print
:
class MyCoolAndAwesomeLogger extends Logger
{
// level = can be "info", "warn", "error", "debug" or "trace"
// args = well... anything... literally
print(level,...args)
{
// do some funny stuff here
}
};
License stuff that nobody reads
Just like any Open Source Project this has a License, the MIT License