npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

logvis

v1.0.6

Published

Minimal lightweight logging for TypeScript/JavaScript, adding reliable log level methods to any available console.log methods

Downloads

285

Readme

logvis

Globals

logvis

TypeScript/JavaScript promise queue client library with concurrency control

Installation

Install with npm:

$ npm install --save logvis

Install with yarn:

$ yarn add logvis

Demo

Try online demo

Documentation

Try online documentation

Classes

logvis

Globals / Logger

Class: Logger

Hierarchy

  • Logger

Implements

  • Console

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

+ new Logger(ns: string): Logger

Defined in index.ts:34

Parameters:

Name | Type | Default value | ------ | ------ | ------ | ns | string | "" |

Returns: Logger

Properties

Console

Readonly Console: any = Logger

Defined in index.ts:34


LEVEL

Readonly LEVEL: typeof LEVEL = LEVEL

Defined in index.ts:32

Accessors

level

• get level(): LEVEL

Defined in index.ts:59

Returns: LEVEL

• set level(level: LEVEL): void

Defined in index.ts:63

Parameters:

Name | Type | ------ | ------ | level | LEVEL |

Returns: void


memory

• get memory(): any

Defined in index.ts:48

Returns: any


namespace

• get namespace(): string

Defined in index.ts:52

Returns: string

Methods

assert

assert(condition?: undefined | false | true, ...data: any[]): void

Defined in index.ts:105

A simple assertion test that verifies whether value is truthy. If it is not, an AssertionError is thrown. If provided, the error message is formatted using util.format() and used as the error message.

Parameters:

Name | Type | ------ | ------ | condition? | undefined | false | true | ...data | any[] |

Returns: void


clear

clear(): void

Defined in index.ts:116

When stdout is a TTY, calling logger.clear() will attempt to clear the TTY. When stdout is not a TTY, this method does nothing.

Returns: void


count

count(label?: undefined | string): void

Defined in index.ts:125

Maintains an internal counter specific to label and outputs to stdout the number of times logger.count() has been called with the given label.

Parameters:

Name | Type | ------ | ------ | label? | undefined | string |

Returns: void


countReset

countReset(label?: undefined | string): void

Defined in index.ts:134

Resets the internal counter specific to label.

Parameters:

Name | Type | ------ | ------ | label? | undefined | string |

Returns: void


debug

debug(...data: any[]): void

Defined in index.ts:143

The logger.debug() function is an alias for {@link console.log()}.

Parameters:

Name | Type | ------ | ------ | ...data | any[] |

Returns: void


dir

dir(item?: any, options?: any): void

Defined in index.ts:154

Uses {@link util.inspect()} on obj and prints the resulting string to stdout. This function bypasses any custom inspect() function defined on obj.

Parameters:

Name | Type | ------ | ------ | item? | any | options? | any |

Returns: void


dirxml

dirxml(...data: any[]): void

Defined in index.ts:163

This method calls {@link console.log()} passing it the arguments received. Please note that this method does not produce any XML formatting

Parameters:

Name | Type | ------ | ------ | ...data | any[] |

Returns: void


disableAll

disableAll(): void

Defined in index.ts:89

Returns: void


enableAll

enableAll(): void

Defined in index.ts:85

Returns: void


error

error(...data: any[]): void

Defined in index.ts:173

Prints to stderr with newline.

Parameters:

Name | Type | ------ | ------ | ...data | any[] |

Returns: void


exception

exception(message?: undefined | string, ...optionalParams: any[]): void

Defined in index.ts:180

Parameters:

Name | Type | ------ | ------ | message? | undefined | string | ...optionalParams | any[] |

Returns: void


getLogger

getLogger(ns: string): Logger

Defined in index.ts:77

Parameters:

Name | Type | ------ | ------ | ns | string |

Returns: Logger


getLoggers

getLoggers(): Dictionary<Logger>

Defined in index.ts:81

Returns: Dictionary<Logger>


group

group(...data: any[]): void

Defined in index.ts:190

Increases indentation of subsequent lines by two spaces. If one or more labels are provided, those are printed first without the additional indentation.

Parameters:

Name | Type | ------ | ------ | ...data | any[] |

Returns: void


groupCollapsed

groupCollapsed(...data: any[]): void

Defined in index.ts:200

The logger.groupCollapsed() function is an alias for {@link console.group()}.

Parameters:

Name | Type | ------ | ------ | ...data | any[] |

Returns: void


groupEnd

groupEnd(): void

Defined in index.ts:210

Decreases indentation of subsequent lines by two spaces.

Returns: void


info

info(...data: any[]): void

Defined in index.ts:219

The {@link console.info()} function is an alias for {@link console.log()}.

Parameters:

Name | Type | ------ | ------ | ...data | any[] |

Returns: void


log

log(...data: any[]): void

Defined in index.ts:229

Prints to stdout with newline.

Parameters:

Name | Type | ------ | ------ | ...data | any[] |

Returns: void


noConflict

noConflict(): Logger

Defined in index.ts:93

Returns: Logger


ns

ns(ns: string): Logger

Defined in index.ts:69

Parameters:

Name | Type | ------ | ------ | ns | string |

Returns: Logger


profile

profile(label?: undefined | string): void

Defined in index.ts:300

This method does not display anything unless used in the inspector. Starts a JavaScript CPU profile with an optional label.

Parameters:

Name | Type | ------ | ------ | label? | undefined | string |

Returns: void


profileEnd

profileEnd(label?: undefined | string): void

Defined in index.ts:311

This method does not display anything unless used in the inspector. Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector.

Parameters:

Name | Type | ------ | ------ | label? | undefined | string |

Returns: void


table

table(tabularData?: any, properties?: string[]): void

Defined in index.ts:240

This method does not display anything unless used in the inspector. Prints to stdout the array array formatted as a table.

Parameters:

Name | Type | ------ | ------ | tabularData? | any | properties? | string[] |

Returns: void


time

time(label?: undefined | string): void

Defined in index.ts:249

Starts a timer that can be used to compute the duration of an operation. Timers are identified by a unique label.

Parameters:

Name | Type | ------ | ------ | label? | undefined | string |

Returns: void


timeEnd

timeEnd(label?: undefined | string): void

Defined in index.ts:258

Stops a timer that was previously started by calling {@link console.time()} and prints the result to stdout.

Parameters:

Name | Type | ------ | ------ | label? | undefined | string |

Returns: void


timeLog

timeLog(label?: undefined | string, ...data: any[]): void

Defined in index.ts:267

For a timer that was previously started by calling {@link console.time()}, prints the elapsed time and other data arguments to stdout.

Parameters:

Name | Type | ------ | ------ | label? | undefined | string | ...data | any[] |

Returns: void


timeStamp

timeStamp(label?: undefined | string): void

Defined in index.ts:323

This method does not display anything unless used in the inspector. Adds an event with the label label to the Timeline panel of the inspector.

Parameters:

Name | Type | ------ | ------ | label? | undefined | string |

Returns: void


trace

trace(...data: any[]): void

Defined in index.ts:277

Prints to stderr the string 'Trace :', followed by the {@link util.format()} formatted message and stack trace to the current position in the code.

Parameters:

Name | Type | ------ | ------ | ...data | any[] |

Returns: void


warn

warn(...data: any[]): void

Defined in index.ts:287

The {@link console.warn()} function is an alias for {@link console.error()}.

Parameters:

Name | Type | ------ | ------ | ...data | any[] |

Returns: void

Enums

logvis

Globals / LEVEL

Enumeration: LEVEL

Index

Enumeration members

Enumeration members

DEBUG

DEBUG:

Defined in index.ts:15


ERROR

ERROR:

Defined in index.ts:18


INFO

INFO:

Defined in index.ts:16


SILENT

SILENT:

Defined in index.ts:13


TRACE

TRACE:

Defined in index.ts:14


WARN

WARN:

Defined in index.ts:17

logvis

Globals

logvis

Index

Namespaces

Enumerations

Classes

Interfaces

Type aliases

Variables

Type aliases

Dictionary

Ƭ Dictionary<TValue>: IDictionary<TValue>

Defined in index.ts:10

Type parameters:

Name | ------ | TValue |

Variables

logger

Const logger: Logger = new Logger()

Defined in index.ts:336


namespaces

Const namespaces: Dictionary<Logger>

Defined in index.ts:21

Interfaces

logvis

Globals / __global / Window

Interface: Window

Hierarchy

  • Window

Index

Properties

Properties

logger

logger: Logger

Defined in index.ts:3

logvis

Globals / IDictionary

Interface: IDictionary<TValue>

Type parameters

Name | ------ | TValue |

Hierarchy

  • IDictionary

Indexable

▪ [key: string]: TValue

Modules

logvis

Globals / __global

Namespace: __global

Index

Interfaces