spins
v1.0.2
Published
use spinners in terminal
Downloads
6
Maintainers
Readme
spins
use spinners on the terminal
features
- [x] succeed spinner
- [x] fail spinner
- [x] apply color to spinner
- [x] stop and persist
- [x] update text
- [x] show warning
- [x] show info
install
npm install spins
# or
yarn add spins
usage
the spins supports all the spinners on the cli-spinners
you can also add your own spinner
creating a spinner is as simple
using the default spinners
const spins = require("spins");
const ani = new spins({
color: "blue",
spinner: "point",
stream: process.stdout
});
- using your own spinner
const spins = require("spins");
const ani = new spins({
color: "blue",
spinner: {
frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"],
interval: 80
},
stream: process.stdout
});
- starting the spinner
ani.start();
- stopping the spinner
ani.stop();
- stopping and persisting the spinner
ani.stopAndPersist();
- updating the text
ani.setText("new text");
- updating the spinner
ani.setSpinner("dots");
- updating the color
ani.setColor("red");
- suceed spinner
ani.success("Some", "text");
- fail spinner
ani.fail("Some", "text");
- info spinner
ani.info("Some", "text");
- warn spinner
ani.warn("Some", "text");
- resume the spinner
ani.resume();
- writing logs to the spinner
ani.log("Some", "text");