Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@trufflesuite/spinnies
Advanced tools
Changelog
[0.1.1] - 2019-05-20
enter
key and thus move the stdout
cursor.Readme
Maintained by the Truffle team, originally forked from jcarpanelli/spinnies
Node.js module to create and manage multiple spinners in command-line interface programs
$ npm i spinnies
const spinnies = new Spinnies();
spinnies.add('spinner-1', { text: 'I am a spinner' });
spinnies.add('spinner-2', { text: 'I am another spinner' });
setTimeout(() => {
spinnies.succeed('spinner-1', { text: 'Success!' });
spinnies.fail('spinner-2', { text: 'Fail :(' });
}, 2000);
This library follows a non-error-throwing philosophy. If you provide an invalid option or an invalid value for a valid option it will be ignored.
Parameters
object
:
color - string
: Any valid chalk color. The default value is white
.
succeedColor - string
: Any valid chalk color. The default value is green
.
failColor - string
: Any valid chalk color. The default value is red
.
spinnerColor - string
: Any valid chalk color. The default value is greenBright
.
succeedPrefix - string
: The default value is ✓.
failPrefix- string
: The default value is ✖.
spinner- object
:
number
string[]
You can see the already provided spinner here.
disableSpins - boolean
: Disable spins (will still print raw messages).
Note: If you are working in any win32
platform, the default spin animation will be overriden. You can get rid of this defining a different spinner animation manually, or by using the integrated VSCode terminal or Windows Terminal.
Example:
const spinner = { interval: 80, frames: ['🍇', '🍈', '🍉', '🍋'] }
const spinnies = new Spinnies({ color: 'blue', succeedColor: 'green', spinner });
Adds a new spinner with the given name.
Parameters:
string
: spinner reference name.object
:
string
: Optional text to show in the spinner. If none is provided, the name
field will be shown.number
: Optional, indent the spinner with the given number of spaces.string
: Initial status of the spinner. Valid statuses are: succeed
, fail
, spinning
, non-spinnable
and stopped
.string
: Any valid chalk color.string
: Any valid chalk color.string
: Any valid chalk color.Return value: Returns the spinner's options.
Example:
const spinnies = new Spinnies();
spinnies.add('spinner-1');
spinnies.add('another-spinner', { text: 'Hello, I am a spinner!', color: 'greenBright' });
Picks a spinner.
Parameters:
string
: spinner reference name.Return value: Returns the spinner's options.
Removes a spinner.
Parameters:
string
: spinner reference name.Return value: Returns the spinner's options.
Updates the spinner with name name
with the provided options.
Parameters:
string
: spinner reference name.object
:
string
: Optional text to show in the spinner. If none is provided, the name
field will be shown.string
: New status of the spinner. Valid statuses are: succeed
, fail
, spinning
, non-spinnable
and stopped
.string
: Any valid chalk color.string
: Any valid chalk color.string
: Any valid chalk color.Return value: Returns the spinner's options.
Example:
const spinnies = new Spinnies();
spinnies.add('spinner-1', { text: 'Hello! I am the initial text', color: 'green' });
// some code
spinnies.update('spinner-1', { text: 'Hello, I am an updated text!', color: 'blue' });
Sets the specified spinner status as succeed
.
Parameters:
string
: spinner reference name.object
:
string
: Optional text to show in the spinner. If none is provided, the name
field will be shown.string
: Any valid chalk color.Return value: Returns the spinner's options.
Example:
const spinnies = new Spinnies();
spinnies.add('spinner-1', { text: 'Hello! I am the initial text', color: 'green' });
// some code
spinnies.succeed('spinner-1', { text: 'Success!', successColor: 'greenBright' });
Sets the specified spinner status as fail
.
Parameters:
string
: spinner reference name.object
:
string
: Optional text to show in the spinner. If none is provided, the name
field will be shown.string
: Any valid chalk color.Return value: Returns the spinner's options.
Example:
const spinnies = new Spinnies();
spinnies.add('spinner-1', { text: 'Hello! I am the initial text', color: 'green' });
// some code
spinnies.fail('spinner-1', { text: 'I failed', failColor: 'redBright' });
Stops the spinners and sets the non-succeeded and non-failed ones to the provided status, which can be succeed
, fail
or stopped
. You can see an example here.
Return value: returns false
if all spinners have succeeded, failed or have been stopped.
Star it, fork it, improve it, PR it! :raised_hands:.
Thanks to chalk for helping making this lib colorful :rainbow: and to ora which was a great inspiration :unicorn:.
FAQs
Create and manage multiple spinners in command-line interface programs
The npm package @trufflesuite/spinnies receives a total of 12,238 weekly downloads. As such, @trufflesuite/spinnies popularity was classified as popular.
We found that @trufflesuite/spinnies demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 17 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.