loading.load

1.1.1 • Public • Published

Logo

Loading-js

Use Loading-js to show animation on console for loading.

Features

  • Multi loading animations
  • change the color with regx

Example

import Loader from 'loading.load'
const loading = new Loader({
    // default_time_message: '[time]',
    // default_message: ' Message: [message]',
    // default_loader_message: '[loading]',
    default_color: 'blue'
});
(async () => {
    function sleep(ms: number) {
        return new Promise(resolve => setTimeout(resolve, ms));
    }
    await loading.load('Downloading packages.', async() => await sleep(5000), 'green');
    await loading.load('Creating Files.', async() => await sleep(2000));
    await loading.load('Final step.', async() => {
        await sleep(1000)
        throw Error('message')
    });
    
    setTimeout(() => {
        loading.end()
    }, 3000);
})();

Readme

Keywords

Package Sidebar

Install

npm i loading.load

Weekly Downloads

4

Version

1.1.1

License

ISC

Unpacked Size

17 kB

Total Files

15

Last publish

Collaborators

  • z7pz