New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

dim-logs

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dim-logs

An easy environment based console logging tool.

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

what is this ?

An easy environment based console logging tool.

Installation

npm i dim-logs

How to Use

set-up env

Default logging

if environment variable NODE_ENV is one of ['PROD', 'prod', 'PRODUCTION', 'production'] logging will be disabled.

Set custom log mode

You can override this by setting LOG_MODE = TRUE / FALSE

Logging

normal Logging

... 
import { consoleLog } from 'dim-logs'; // import
...
.
...
consoleLog('MY-LOGS'); // logging
...

styled Logging 😎

import { dimLog } from 'dim-logs';
.
.
.
dimLog('dim-log is easy', {
  color: 'green',
  background: 'skyblue',
  fontWeight: 'bold',
  fontSize: 50,
});

or //

dimLog('dim-log is easy', 'color: green; font-weight: bold;');
...

other console Logging methods


import { 
  consoleLog,
  consoleError,
  consoleDebug,
  consoleAssert,
  consoleDir,
  consoleDirxml,
  dimLog, 
} from 'dim-logs';

...
...
consoleLog('MY-LOGS');
consoleError('MY-ERROR');
consoleDebug('MY-DEBUG');
consoleAssert(false, 'MY-ASSERT');
consoleDir({ name: 'Navin', address: { city: 'MUMBAI', state: 'maharashtra' } });
consoleDirxml(document);
...
...

Keywords

consolelog

FAQs

Package last updated on 13 Sep 2020

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