Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nanospinner

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nanospinner

Simple and tiny multi spinner library for Node.js

  • 0.1.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
181K
decreased by-21.32%
Maintainers
1
Weekly downloads
 
Created

What is nanospinner?

The nanospinner npm package is a lightweight and simple terminal spinner for Node.js applications. It is used to display a spinner in the terminal to indicate that a process is ongoing, which can enhance the user experience by providing visual feedback during long-running operations.

What are nanospinner's main functionalities?

Basic Spinner

This feature allows you to create a basic spinner that starts immediately and stops after a specified duration, indicating success.

const { createSpinner } = require('nanospinner');

const spinner = createSpinner('Loading...').start();

setTimeout(() => {
  spinner.success({ text: 'Done!' });
}, 2000);

Custom Spinner Styles

This feature allows you to customize the spinner style. In this example, the 'dots' style is used, and the spinner indicates failure after a specified duration.

const { createSpinner } = require('nanospinner');

const spinner = createSpinner('Loading...', { spinner: 'dots' }).start();

setTimeout(() => {
  spinner.error({ text: 'Failed!' });
}, 2000);

Spinner with Custom Interval

This feature allows you to set a custom interval for the spinner's animation. The spinner text is updated midway through the process, and it indicates success at the end.

const { createSpinner } = require('nanospinner');

const spinner = createSpinner('Loading...', { interval: 100 }).start();

setTimeout(() => {
  spinner.update({ text: 'Almost there...' });
}, 1000);

setTimeout(() => {
  spinner.success({ text: 'Done!' });
}, 2000);

Other packages similar to nanospinner

Keywords

FAQs

Package last updated on 02 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc