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

logress

v2.0.2

Published

log your progress, with Logress!

Downloads

4

Readme

Logress version License Build Status Downloads Coverage Status

Log your progress, with Logress!

demo

Install

npm install --production --save logress

Usage

const Logress = require('logress')

const log = new Logress()

log.start(1, 'Loading ...')

setTimeout(() => log.update(1, 'still loading!', { color: 'yellow' }), 1000)
setTimeout(() => log.start(2, 'monkeys are cuter than unicorns!', 'monkey'), 2000)

API

constructor(options = { stream = process.stderr, spinner = 'dots' })

Note: It will gracefully not do anything when there's no TTY or when in a CI.

option | required | type | description | default
------------- | -------- | ------------------------------- | ------------------------------ | ---------------- stream | ✖ | WritableStream | a Stream to write the output | process.stderr spinner | ✖ | String, Object | a Default Spinner | dots

const log = new Logress({
  stream: process.stdout,
  spinner: 'bouncingBar'
})

log.end([message])

terminates all spinners, restores the cursor, optionally sends a goodbye message out

argument | required | type | description | default ------------- | -------- | -------- | ------------ | ------- message | ✖ | String | goodbye text | -

new Logress().end('bye!')

log.start(id[, text][, spinner])

starts a new spinner instance on the line, sets the line text. (will create the line if it doesn't exit)

argument | required | type | description | default
------------- | -------- | ------------------ | ----------------------------------------------- | ------------------------ id | ✔ | String | line identifier | -
text | ✖ | String | line text | -
spinner | ✖ | String, Object | assign a new Spinner for this line | inherits default Spinner

log.update(id[, text][, spinner])

similar to log.start() but will update existing spinner rather than start a new one

argument | required | type | description | default
------------- | -------- | ------------------ | ----------------------------------------------- | ------------------------ id | ✔ | String | line identifier | -
text | ✖ | String | line text | -
spinner | ✖ | String, Object | assign a new Spinner for this line | inherits default Spinner

const log = new Logress({ spinner: 'monkey' })

log.start('ape', 'I like bananas', { color: 'yellow' })
log.start('angry', 'an angry monkey!', { color: 'red' })

log.stop(id[, text])

terminate spinner at line: id, optionally change the text

argument | required | type | description | default ---------- | -------- | -------- | --------------- | ------- id | ✔ | String | line identifier | -
text | ✖ | String | line text | -

log.stop('ape')
log.stop('angry', 'no more angry monkey!')

log.set(id[, text])

sets the line text (overwriting any existing spinner). (will create the line if it doesn't exit)

argument | required | type | description | default ---------- | -------- | -------- | --------------- | ------- id | ✔ | String | line identifier | -
text | ✖ | String | line text | -

log.set('new', 'custom text')

log.prefix(id, prefix, [, text])

  • will terminating any existing spinner
  • replaces spinner with a custom prefix
  • optionally sets a new line text
  • will create the line if it doesn't exit
  • will match prefix against (:info:, :success:, :warning:, :error:) and replace with an emoji if matched

argument | required | type | description | default
------------ | -------- | -------- | --------------- | -------------- id | ✔ | String | line identifier | -
prefix | ✔ | String | line prefix | -
text | ✖ | String | line text | previous value

log.prefix('line1', '*')

log.info(id, [, text])

alias to `log.prefix(id, 'ℹ', text)

log.success(id, [, text])

alias to `log.prefix(id, '✔', text)

log.succeed(id, [, text])

alias to `log.prefix(id, '✔', text)

log.warning(id, [, text])

alias to `log.prefix(id, '⚠', text)

log.warn(id, [, text])

alias to `log.prefix(id, '⚠', text)

log.error(id, [, text])

alias to `log.prefix(id, '✖', text)

log.fail(id, [, text])

alias to `log.prefix(id, '✖', text)

Spinners

You can use any of the provided spinners or create your own, See demo/index.js in this repo if you want to test out different spinners.


License: ISC • Copyright: ahmadnassri.com • Github: @ahmadnassri • Twitter: @ahmadnassri