An open API service indexing awesome lists of open source software.

https://github.com/xxczaki/xa

Beautiful & Customizable logger :heart:
https://github.com/xxczaki/xa

beautiful chalk cli color javascript log log-message message nodejs npm package simple terminal xa

Last synced: 27 days ago
JSON representation

Beautiful & Customizable logger :heart:

Awesome Lists containing this project

README

        



xa


Simple console logger, that works in Node.js, Electron and the Browser :heart:




Build Status XO Code Style
Unicorn




Screenshot

---

## Highlights

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

## Install

```
npm install xa
```



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