npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-terminal-logger

v1.3.8

Published

Simple console logger for vue, react and react-native

Downloads

61

Readme

React terminal logger

npm

Simple console logger for vue, react and react-native

New Features!

  • Saving logs to a file (optional)
  • Short alias for console.log

Getting Started

To install the module, run the following in the command line:

npm i react-terminal-logger --save

Use within your application with the following line of JavaScript:

const ReactLogger = require('react-terminal-logger/console-logger');

or

import ReactLogger from 'react-terminal-logger/console-logger'

Run this command in your project's index file:

ReactLogger.start(); //Quick start with standard configuration

To run the logger in the terminal, you need to run the command in your project directory:

npx react-terminal-logger

You can specify the port on which the logger will run:

npx react-terminal-logger --p=1234

Configuration

You can specify what information to show in the terminal:

ReactLogger.start(
    ["log", "error", "info", "warn", "logr"], //You can specify what information to show in the terminal
    true, //Save logs to a file. Your logs will be saved in directory react-logger-logs. Default: false
    true, //Show only message in terminal. Ignores the value of stacktrace_hide. Default: false
    1234, //Port on which the logger is running. Default: 1234
    true //Hide stacktrace. Default: false
);

or

ReactLogger.config({
    visible : ["log", "error", "info", "warn", "logr"], //You can specify what information to show in the terminal
    save_logs: true, //Save logs to a file. Your logs will be saved in directory react-logger-logs. Default: false
    only_msg : true, //Show only message in terminal. Ignores the value of stacktrace_hide. Default: false
    port: 1234, //Port on which the logger is running. Default: 1234
    stacktrace_hide: true //Hide stacktrace. Default: false
});
ReactLogger.start();

In addition to the standard console.log, console.info, console.error, console.warn added a quick command for logging:

logr("your log"); //window.logr("your log")
logr("your log", 1, [{"a1": 1}]); //window.logr("your log", 1, [{"a1": 1}])

You can use this command anywhere, it is enough to include our module in the index file.