Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

status-logger

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

status-logger

print updating progress to console and stdout

  • 3.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Status Logger

Manage complex CLI output with arrays and automatically print any changes to stdout via ansi-diff-stream.

WARNING: Awesomeness elsewhere. status-logger was nice but it wasn't enough, it still felt like node but I wanted frontend javascript fun. Introducing... 🥁 ... neat-log. neat-log is much neater and I'd definitely recommend using that. It uses status-logger under the hood.

Example

The example here will initially print:

Status Logger Example:
starting...

Then once it gets started, it will print the time every second:

Status Logger Example:
Time = 10 seconds
var output = ['Status Logger Example:', 'starting...']
var log = statusLogger(output)
setInterval(function () {
  log.print()
}, 100)
log.print()
start()

function start () {
  var sec = 0
  setInterval(function () {
    sec++
    output[1] = `Time = ${sec} seconds`
  }, 1000)
}

Run node basic-example.js or node example.js to see full examples. You can find more complex usage in these modules:

  • Dat CLI Using neat-log now (built on this)
  • bkr

Installation

npm install status-logger

API

var log = statusLogger(messages, opts)

messages is an array with of lines to print. They will be printed in order with a newline spacer between each. Message arrays are flattened so they can be any mix of nested arrays and strings.

Options

  • quiet: do not print anything
  • debug: print everything to console.log or console.error

log.print()

Print messages from all groups.

var output = log.clear(messages)

Clear all output and create a empty output array (or with new messages).

log.diff

ansi-diff-stream instance

log.messages

Stored reference to the original messages array.

License

MIT

FAQs

Package last updated on 26 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc