loading.load
v1.1.1
Published
loading console
Downloads
2
Readme
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);
})();