Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bk-awesome-log

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bk-awesome-log

Fall in love with your console

  • 2.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

awesome-log.js

Your js console.log with superpowers!

This package will make you fall in love with your console! In case you already haven't... It was designed for fun, with some learning purpouses in the mind. But, it also provides some functionality, for example you can inspect FormData without using loop - this package does it for you!


How to use it?

As this package is really simple here is quick referrence how to use it in your project:


  • Installation

    npm install bk-awesome-log
    
  • Usage

    • First you need to import package to your project:

      import {BaseLogger} from 'bk-awesome-log'
      
    • Then you have to init logger object. If you are using TS, you will get type suggestions as this project was written with TS in mind.

      const logger = new BaseLogger({
          name: 'Bartosz',
          organization: 'Owls Department',
          componentName: 'The Menu',
          showGreet: true,
      }, () => {
          // your code...
      })
      
    • Once you have instance of component you can use following methods:

      • This method log to the console. As a second parameter you can pass optional heading - the default one is Log
      logger.log("Hello world!");
      
      • This method allows you to show warning in the console. As a second parameter you can pass optional heading - the default one is Warning
      logger.warn("Make sure to turn into production mode!");
      
      • This method allows you to show error in the console. As a second parameter you can pass optional heading - the default one is Error
      logger.error("Hey, something went wrong fetching data!");
      
    • Available config options:

      Option nameTypeDefaultDescription
      showGreetbooleanfalseFlag that indicates whether you want to show greet message on init.
      namestring''Your name, useful when showGreet is set to true
      organizationstring''Your organization name, useful when showGreet is set to true
      componentNamestring''Your component name, useful when showGreet is set to true
    • onMounted hook: You can pass a second parameter to class constructor, that will be called after config initialization. This is similar to lifecycle hooks that you can see in every modern JS framework.

Keywords

FAQs

Package last updated on 30 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc