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

envlog

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

envlog

A typescript console logger with an environment variable switch.

latest
Source
npmnpm
Version
1.0.5
Version published
Weekly downloads
115
379.17%
Maintainers
1
Weekly downloads
 
Created
Source

envlog

A typescript console logger with an environment variable switch.

Features

  • set the environment key and value to match or inverse match.
  • optionally prints the line where the logger was called
  • smallest possible size and lightest cpu load

Usage

install

npm i envlog

import spawnLogger

import spawnLogger from 'envlog'

spawn a logger

Specify an environment variable to watch and then either an onValue OR offValue to match against.

const logger = spawnLogger({ envKey: string, // The key in environment variables to watch eg. 'LOGS' = process.env.LOGS onValue: string, // Log when environment value matches this value offValue: string, // Log when environment variable does not match this value stackTraceLines: number // Number of stack trace lines to show (Optional, default: 1) });

use the logger:

logger.log('example') logger.info(123) logger.warn({ key: 'val' }) logger.error([1, 2, 3])

Keywords

console

FAQs

Package last updated on 22 Jun 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