rxjslog
TypeScript icon, indicating that this package has built-in type declarations

1.3.1 • Public • Published

rxjslog

Log RxJS events nicely to the console.

The next, error and complete events have their own icon and the log messages have their own color so they stand out between the other log messages.

Rxjslog works in both the browser as in Node.js environments.

Install

npm install rxjslog

Example code

import {interval} from 'rxjs';
import {take} from 'rxjs/operators';
 
import {log} from "rxjslog";
 
const myObservable = interval(500).pipe(take(3));
 
myObservable.pipe(log("myObservable"))
    .subscribe();

Example output

Example output of rxjslog

Configuration

You can configure the icons and colors used.

For the next, error and complete complete log messages, you can set the icon and color.

To stay compatible with Node.js log messages, use only one of these colors: black, red, green, yellow, blue, magenta, cyan and white.

Example:

import {logConfig} from "rxjslog";

logConfig({ error: { icon: "❗", color: "red" } });

License

Rxjslog is written by Edwin Martin and is published under the MIT license.

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i rxjslog

    Weekly Downloads

    1

    Version

    1.3.1

    License

    MIT

    Unpacked Size

    49.7 kB

    Total Files

    10

    Last publish

    Collaborators

    • edwinm