You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

ink-spinner

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ink-spinner

Spinner component for Ink

5.0.0
latest
Source
npmnpm
Version published
Weekly downloads
503K
-6.85%
Maintainers
1
Weekly downloads
 
Created

What is ink-spinner?

The ink-spinner npm package provides a collection of customizable spinner components for use with Ink, a React-like library for building command-line interfaces. It allows developers to add loading spinners to their CLI applications, enhancing the user experience by indicating ongoing processes.

What are ink-spinner's main functionalities?

Basic Spinner

This feature demonstrates how to use a basic spinner in an Ink application. The spinner type is set to 'dots', and it is displayed alongside a 'Loading...' message.

const { render } = require('ink');
const Spinner = require('ink-spinner').default;
const React = require('react');

const App = () => (
  <div>
    <Spinner type="dots" /> Loading...
  </div>
);

render(<App />);

Custom Spinner Type

This feature shows how to use a custom spinner type. In this example, the spinner type is set to 'line', and it is displayed with a 'Processing...' message.

const { render } = require('ink');
const Spinner = require('ink-spinner').default;
const React = require('react');

const App = () => (
  <div>
    <Spinner type="line" /> Processing...
  </div>
);

render(<App />);

Spinner with Custom Color

This feature demonstrates how to customize the color of the spinner. The spinner type is 'dots', and it is wrapped in a Color component to display it in green.

const { render } = require('ink');
const Spinner = require('ink-spinner').default;
const React = require('react');
const { Color } = require('ink');

const App = () => (
  <div>
    <Color green>
      <Spinner type="dots" /> Loading...
    </Color>
  </div>
);

render(<App />);

Other packages similar to ink-spinner

Keywords

ink

FAQs

Package last updated on 01 Mar 2023

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