# tacker

> Console log helpers for your debugging journey

Latest version **0.3.2** (published 2019-08-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install tacker
pnpm add tacker
yarn add tacker
bun add tacker
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.2 |
| Published | 2019-08-08 |
| First published | 2019-07-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 562.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | alechp |
| Keywords | servexyz, tacker, debug, logger, debug logger, chalk, terminal, print line, print variable, print mirror, print JSON variable, print package version, print package property, conditional logs |

## Links

- npm: https://www.npmjs.com/package/tacker
- Repository: https://github.com/servexyz/tacker
- Homepage: https://github.com/servexyz/tacker#readme
- Issues: https://github.com/servexyz/tacker/issues
- npm.io page: https://npm.io/package/tacker

## Dependencies (5)

- [chalk](https://npm.io/package/chalk.md) ^2.4.2
- [fs-extra](https://npm.io/package/fs-extra.md) ^8.1.0
- [is-empty](https://npm.io/package/is-empty.md) ^1.2.0
- [get-pkg-prop](https://npm.io/package/get-pkg-prop.md) ^0.2.0
- [@sindresorhus/is](https://npm.io/package/@sindresorhus/is.md) ^1.0.0

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 0.3.2 (latest) — 2019-08-08
- 0.3.1 — 2019-08-06
- 0.3.0 — 2019-08-06
- 0.2.9 — 2019-07-27
- 0.2.8 — 2019-07-27
- 0.2.7 — 2019-07-23
- 0.2.6 — 2019-07-22
- 0.2.5 — 2019-07-22
- 0.2.4 — 2019-07-21
- 0.2.3 — 2019-07-21
- 0.2.2 — 2019-07-21
- 0.2.1 — 2019-07-21
- 0.2.0 — 2019-07-21
- 0.1.2 — 2019-07-09
- 0.1.1 — 2019-07-09
- … 1 more at https://npm.io/package/tacker/versions

## README

![logo](./docs/Tacker.png)

> Console log helpers for your debugging journey

![travis-build-status](https://travis-ci.org/servexyz/tacker.svg?branch=master)


## Getting Started

#### Install

```sh
npm install tacker -S
```

#### Add to source

```js
import { printLine, printMirror, printPkgVersion, printPkgProp } from "tacker";
```

## API

<details><summary><code>printLine(szColor || oColor)</code> - Sync </summary>

<h4>Where</h4>

<ul>
<li><em>szColor</em> is a string. Color options can be found on <a href="https://www.npmjs.com/package/chalk" >chalk's readme</a> or in source here</li>
<li><em>oColor</em> is an object comprised of properties so you can mnaually configure the line 
<ul>
<li><code>color</code>: the color of the line; default is <b>blue</b></li>
<li><code>character</code>: the character which will make up the line; default is <b>-</b></li>
<li><code>length</code>: represents the number of characters to repeat; default is <b>59</b></li>
<li><code>quantity</code> represents the number of lines to print; default is <b>1</b></li>
</ul>
</li>
</ul>

<h4>Examples</h4>

<ul>
<li> <code>printLine("blue")</code></li>
<li> <code>printLine({color:"blue", character:"-","length:59",quantity:1})</code></li>
</ul>

<h4>Output</h4>
<em>Both of the above examples produce this identical output</em>

<img src="./docs/blueLine.png" alt="printLine output" />

<hr />
</details>

<details><summary><code>printMirror({ mVariable }, szKeyColor, szValueColor)</code> - Sync</summary>

This will print the variable's name and the variable's value (regardless of variable type).

<h4>Where</h4>
<ul>
<li><em>mVariable</em> is an object or a variable you would like to print. If it's an object or an array, it will pretty-print using JSON.stringify.</li>
<li><em>szVariableKeyColor</em> is a string of the variable's key.  </li>
<li><em>szVariableValueColor</em> is an object or a variable</li>
</ul>

<h4>Example</h4>
<code>
const mock = {
    foo: "bar"
  };
printMirror({mock}, "blue", "grey")
</code>

<h4>Output</h4>
<img src="./docs/printMirror.png" alt="printMirror output"/>

<hr />
</details>

<details><summary><code>printPkgVersion(mPkgSource)</code> - Async</summary>
<hr />

This will print the version of the specified package.

<h4>Where</h4>
<ul>
<li><em>mPkgSource</em> allows you to specify which package to read from.

<ul>
<li> <code>undefined</code> </li>
<li> <code>string</code></li>
<li> <code>object</code></li>
</ul>
</li>
</ul>

<h4>Example</h4>
<ul>
<li><code>await printPkgVersion()</code></li>
<li><code>await printPkgVersion("/path")</code></li>
<li><code>await printPkgVersion("/path/package.json")</code></li>
<li><code>await printPkgVersion({ name: "tacker", version: "x.y.z", ...})</code></li>
</ul>

<h4>Output</h4>
<img src="./docs/printPkg.png" alt="printPkgVersion"/>

<hr />
</details>

<details><summary><code>printPkgProp(szProperty, mPkgSource)</code> - Async</summary>

This will print any property from the specified package.

<h4>Where</h4>
<ul>
<li><em>szProperty</em></li> allows you to specify the package property.
<li><em>mPkgSource</em> allows you to specify which package to read from.

<ul>
<li> <code>undefined</code> </li>
<li> <code>string</code></li>
<li> <code>object</code></li>
</ul>
</li>
</ul>

<h4>Example</h4>
<ul>
<li><code>await printPkgProp("version")</code> </li> 
<li><code>await printPkgProp("version", "/path")</code></li>
<li><code>await printPkgProp("version", "/path/package.json")</code></li>
<li><code>await printPkgProp("version", { name: "tacker", version: "x.y.z", ...})</code></li>
</ul>

<h4>Output</h4>
<img src="./docs/printPkg.png" alt="printPkgVersion"/>

<hr />
</details>


## FAQ

<details><summary>Name</summary>
Portmaneau of "tack" and "logger"

In a sailing context, tack means <em>"change course by turning a boat's head into and through the wind"</em>
</details>
<details><summary>Why</summary>There's reasons to use more sophisticated tooling (stack traces, Chrome dev tools, etc). However, when you're getting up-and-running with a project, it's extremely helpful to be able to log values. The issue is before long, your terminal is contaminated with a slew of logs. Tacker exists to solve this</details>
<details><summary>How</summary>
<ul>
<li> Make logs prettier (current)</li>
<li> Only log things in certain circumstances (future)</li>
</ul>
</details>

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