New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

keyload

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

keyload

A loading bar

latest
Source
npmnpm
Version
2.2.5
Version published
Weekly downloads
5
-37.5%
Maintainers
1
Weekly downloads
 
Created
Source

keyload

A progress bar NodeJS
keyload demo

Example

npm install keyload --save

var KeyLoad = require('keyload')

var bar = new KeyLoad({
  whole: 20, // Total amount for loading bar
  undone: ' ', // Character for the undone section of the loading bar
  done: '=', // Character to be used for the finished sectiond of the loading bar
  middle: '>', // The middle character on the loading bar
  stream: process.stderr // The stream for output
})

// Interval for ticking up the bar
var interval = setInterval(bar.tick, 500)

// Interval for setting a random message on the bar
var interval2 = setInterval(function() {
  bar.message('f'.repeat(Math.round(Math.random() * 100) % 16))
}, 500)

// Listener for the bar being finished
bar.on('end', function() {
  clearInterval(interval)
  clearInterval(interval2)
  console.log('complete')
})

// Increasing the bar by one
bar.tick()

API

tick()

Increases the bar by one.

on(eventStr, callback)

Listen for events on the bar. Currently only end is supported.

message(string)

Put a message on the loader bar. It will be truncated or removed if there is not enough space. This is the alternative to console.log while using this bar, since it unfortunately breaks it.

Keywords

loader

FAQs

Package last updated on 18 Apr 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