# xa

> Simple console logger, that works in Node.js, Electron and the Browser ❤

Latest version **2.4.0** (published 2020-04-01) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 40/100 (D)** — status: abandoned.

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

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.4.0 |
| Published | 2020-04-01 |
| First published | 2015-12-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=8 |
| Dependencies | 3 |
| Unpacked size | 6.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 83 |
| Author | Antoni Kepinski |
| Maintainers | akepinski |

## Links

- npm: https://www.npmjs.com/package/xa
- Repository: https://github.com/xxczaki/xa
- Issues: https://github.com/xxczaki/xa/issues
- npm.io page: https://npm.io/package/xa

## Dependencies (3)

- [chalk](https://npm.io/package/chalk.md) ^3.0.0
- [color](https://npm.io/package/color.md) ^3.1.2
- [electron-is](https://npm.io/package/electron-is.md) ^3.0.0

## Recent versions

- 2.4.0 (latest) — 2020-04-01
- 2.3.0 — 2019-08-28
- 2.2.2 — 2019-07-25
- 2.2.1 — 2019-07-04
- 2.2.0 — 2019-07-03
- 2.1.0 — 2019-04-24
- 2.0.2 — 2019-04-20
- 2.0.1 — 2019-04-16
- 2.0.0 — 2019-04-16
- 1.1.1 — 2018-09-19
- 1.1.0 — 2018-07-17
- 1.0.6 — 2018-05-13
- 1.0.5 — 2018-01-28
- 1.0.4 — 2018-01-28
- 1.0.3 — 2018-01-17
- … 7 more at https://npm.io/package/xa/versions

## README

<p align="center">
  <img src="https://i.imgur.com/2n3U5I8.png" href="https://github.com/xxczaki/xa" height="256">
  <h2 align="center">xa</h2>
  <p align="center">Simple console logger, that works in Node.js, Electron and the Browser :heart:<p>
  
<p align="center">  
<a href="https://travis-ci.org/xxczaki/xa"><img src="https://travis-ci.org/xxczaki/xa.svg?branch=master" alt="Build Status"></a> <a href="https://github.com/sindresorhus/xo"><img src="https://img.shields.io/badge/code_style-XO-5ed9c7.svg" alt="XO Code Style"></a> 
<a href="https://www.youtube.com/watch?v=9auOCbH5Ns4"><img src="https://img.shields.io/badge/unicorn-approved-ff69b4.svg" alt="Unicorn"></a>
  </p>
  
 
<p align="center"><img src="screenshot.png" alt="Screenshot"></p>

---

## Highlights

* Simple API
* Works in Node.js, Electron and the Browser
* Customizable
* Written in TypeScript

## Install

```
npm install xa
```

<a href="https://www.patreon.com/akepinski">
	<img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" width="160">
</a>

## Usage

```js
const xa = require('xa');

xa.success('Build finished!');
xa.custom('TITLE', 'Nice description', {titleColor: 'yellow', backgroundColor: '#212121'});
```

## API

## xa

Main method

### success(text)

**text**

Type: `string`

A text you want to display


### info(text)

**text**

Type: `string`

A text you want to display

### warning(text)

**text**

Type: `string`

A text you want to display

### error(text)

**text**

Type: `string`

A text you want to display

### custom(title, text, {titleColor, backgroundColor})

**title**

Type: `string`

Title of the log. When in Electron, the title will be either `MAIN` or `RENDERER`.

**text**

Type: `string`

A text you want to display

**titleColor**

Type: `string`
Default: `white`

Color of the title. It will be converted to HEX.

**backgroundColor**

Type: `string`
Default: `black`

Color of title's background. It will be converted to HEX.

## Thanks:

- [Jamen Marzonie](https://www.npmjs.com/~jamen) for providing package name!

## License

MIT © [Antoni Kepinski](https://kepinski.me)

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