1.2.3 • Published 12 months ago

node-cli-loader v1.2.3

Weekly downloads
-
License
ISC
Repository
github
Last release
12 months ago

Node CLI Loader

Plugin to create animated loaders in the terminal programmatically.

Install

npm install node-cli-loader

Usage

Creates a new loader:

// Default loader (Loading...)
Loader.create()

// Custom loader (Start loading...)
Loader.create('Start loading', { 
  spinname: 'dots',
  doneMessage: 'Loading finished!'
})

Arguments:

nameDESCRIPTIONVALUE TYPEEXAMPLEDEFAULT
descriptionMessage to show when loading and renderingstringRequesting dataLoading
optionsCustom options for the loaderobjectLoaderOptions{}

Options (LoaderOptions):

nameDESCRIPTIONVALUE TYPEEXAMPLEDEFAULT
spinnameName of the spinner to be displayedstring'dots', 'sand''dots'
doneMessageMessage to change the loader when finishesstring'Loading finish!'
timeoutThe time in milliseconds to wait before stopping the loaderstring1000

See all the spinners.

Stop the loader and mark it as done.

const loader = Loader.create()
// Some logic here...
loader.finish()

Stop the loaders and mark them as failures:

Loader.interrupt()

Stops all loaders in course:

Loader.stopAll()

Based on packages:

1.2.3

12 months ago

1.2.2

12 months ago

1.2.1

12 months ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago