console-prefix-proxy
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

console-prefix-proxy

Adds prefix to message for JavaScript console

Usage

import ConsolePrefix from 'console-prefix-proxy';

const logger = ConsolePrefix({
  prefix: (method: string) => method.toUpperCase(),
});

Options

prefix

string | (method: string) => string

default: () => (new Date().toISOString())

methods

string[]

default: ['debug', 'log', 'info', 'warn', 'error']

console

Console

default: globalThis.console

Readme

Keywords

Package Sidebar

Install

npm i console-prefix-proxy

Weekly Downloads

37

Version

0.1.0

License

MIT

Unpacked Size

3.21 kB

Total Files

5

Last publish

Collaborators

  • ghnacker