# @element-ts/neon

> A helpful logging package with types, formatting, stacks, and colors.

Latest version **1.0.3** (published 2020-06-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @element-ts/neon
pnpm add @element-ts/neon
yarn add @element-ts/neon
bun add @element-ts/neon
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2020-06-02 |
| First published | 2020-04-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 10.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Elijah Cobb |
| Maintainers | ejc |
| Keywords | log, console, color, error, type, message, stack |

## Links

- npm: https://www.npmjs.com/package/@element-ts/neon
- Repository: https://github.com/element-ts/neon
- Homepage: https://github.com/element-ts/neon#readme
- Issues: https://github.com/element-ts/neon/issues
- npm.io page: https://npm.io/package/@element-ts/neon

## Dependencies (1)

- [colors](https://npm.io/package/colors.md) latest

## 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

- 1.0.3 (latest) — 2020-06-02
- 1.0.2 — 2020-05-13
- 1.0.1 — 2020-05-12
- 1.0.0 — 2020-04-21

## README

# neon

Welcome to the neon wiki! This is a work in progress and will be constantly updated. Below you will find pages to
this wiki but also feel free to view some nice features and information about the package.

[Want to buy my next coffee? :)](https://www.buymeacoffee.com/elijahjcobb)

## Summary
Neon is a simple package the provides really helpful logging. With even just the default options, Neon makes
`console.log()` look like a smudge on a rock. It provides the type of the logged value, the stack it came from, and
prints using the [colors](https://www.npmjs.com/package/colors) package.

In order to use Neon, once you import it and make a new instance, call `enable()`. The reason you have to enable it
is so when you are ready for logs to go away, all you have to do is remove that line, or call `disable()`.

#### Example
```typescript
import {Neon} from "@element-ts/neon";

const neon = new Neon();

neon.enable();

neon.setTitle("MyLogger");
neon.log("Hello from MyLogger.");
neon.clearTitle();
neon.log("Hello, world!");
neon.log(1223456789);
neon.log(true);
neon.log({foo: "bar"});
neon.log([1, 2, 3]);
neon.log(Buffer.from("Hello, world!"));

neon.err("AHHHH!");
neon.err(new Error("WHOA WHOA!"));
neon.err("AHHHH!", true);
```

![neon example from terminal](./neon-example.png)

## About

### Why not make it static methods?!
I originally had it all being static methods but when I wanted to use neon in multiple projects and then the projects
together it would not work because only one instance of neon could ever exist and different components of a codebase
might want to log things in separate ways. This way you can just attach an instance of neon as a static property on a
class. For example, in [element-ts/silicon](https://github.com/element-ts/silicon) there is a static property called
`logger` on `SiDatabase` so all silicon code can just reference its own neon instance.

### Language
All of Neon is written in [TypeScript](https://www.typescriptlang.org). If you do not know how to use TypeScript don't
worry. It is completely compatible with JavaScript.

### Why?
I kept writing the same kind of logging system in all of my projects.

### Author/Maintainer
My name is [Elijah Cobb](https://elijahcobb.com). I am a computer science student at
[Michigan Technological University](https://mtu.edu).

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