# global-console-prefix

> Add a commong prefix to every single console.log message

Latest version **2.0.0** (published 2016-07-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install global-console-prefix
pnpm add global-console-prefix
yarn add global-console-prefix
bun add global-console-prefix
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2016-07-24 |
| First published | 2016-06-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | @camilin87 |
| Maintainers | camilin87 |
| Keywords | console, prefix, global |

## Links

- npm: https://www.npmjs.com/package/global-console-prefix
- Repository: https://github.com/camilin87/global-console-prefix
- Homepage: https://github.com/camilin87/global-console-prefix#readme
- Issues: https://github.com/camilin87/global-console-prefix/issues
- npm.io page: https://npm.io/package/global-console-prefix

## Dependencies (1)

- [util](https://npm.io/package/util.md) ^0.10.3

## Recent versions

- 2.0.0 (latest) — 2016-07-24
- 2.0.0-beta.1 — 2016-07-24
- 1.1.0 — 2016-07-24
- 1.1.0-beta.4 — 2016-07-24
- 1.1.0-beta.3 — 2016-07-24
- 1.1.0-beta.2 — 2016-07-24
- 1.1.0-beta.1 — 2016-07-24
- 1.0.1 — 2016-06-25
- 1.0.0 — 2016-06-25
- 0.0.1 — 2016-06-25

## README

# global-console-prefix  

[![Build Status](https://travis-ci.org/camilin87/global-console-prefix.svg?branch=master)](https://travis-ci.org/camilin87/global-console-prefix)  

Add a your own prefix to every single `console` message.

## Usage  

```js
require("global-console-prefix")("[MONEY_APP]");

console.log("starting execution", {name: "crawler"});
console.info("starting execution", {name: "crawler"});
console.warn("starting execution", {name: "crawler"});
console.error("starting execution", {name: "crawler"});

//Output:
//[INFO][MONEY_APP] starting execution { name: 'crawler' }
//[INFO][MONEY_APP] starting execution { name: 'crawler' }
//[ERROR][MONEY_APP] starting execution { name: 'crawler' }
//[ERROR][MONEY_APP] starting execution { name: 'crawler' }
```


## Remarks  
Executes the default `console` methods when no prefix is specified.  

Hides the log level when a second parameter is specified.  

```js
require("global-console-prefix")("[MONEY_APP]", true);
```

---
_Source: https://npm.io/package/global-console-prefix · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
