An util function to show a simple loading animation on a terminal.
- Windows
yarn add node-console-loading
or
npm install node-console-loading
import createLoader from "node-console-loading";
//Creating a loading animation
createLoader(yourPromise, "Resolved! :)", "Rejected! :(");
//Use case using axios
import axios from "axios";
const requestPromise = axios.get("https://example.com/");
createLoader(requestPromise, "Resolved! :)", "Rejected! :(");
//Using your own custom animation
const frames = [
". ",
" . ",
" . ",
" .",
" . ",
" . ",
]
createLoader(yourPromise, "Resolved! :)", "Rejected! :(", frames);
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.