Socket
Socket
Sign inDemoInstall

elegant-spinner

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 2.0.0

index.d.ts

11

index.js
'use strict';
var frames = process.platform === 'win32' ?
const frames = process.platform === 'win32' ?
['-', '\\', '|', '/'] :
['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
module.exports = function () {
var i = 0;
module.exports = () => {
let i = 0;
return function () {
return frames[i = ++i % frames.length];
return () => {
i = ++i % frames.length;
return frames[i];
};

@@ -13,0 +14,0 @@ };

{
"name": "elegant-spinner",
"version": "1.0.1",
"description": "Elegant spinner for interactive CLI apps",
"license": "MIT",
"repository": "sindresorhus/elegant-spinner",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "xo && node test.js"
},
"files": [
"index.js"
],
"keywords": [
"ansi",
"terminal",
"console",
"cli",
"string",
"log",
"logging",
"spinner",
"busy",
"indicator",
"loading",
"loader",
"progress",
"elegant",
"loiter",
"interactive"
],
"devDependencies": {
"ava": "0.0.4",
"xo": "*"
}
"name": "elegant-spinner",
"version": "2.0.0",
"description": "Elegant spinner for interactive CLI apps",
"license": "MIT",
"repository": "sindresorhus/elegant-spinner",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"ansi",
"terminal",
"console",
"cli",
"string",
"log",
"logging",
"spinner",
"busy",
"indicator",
"loading",
"loader",
"progress",
"elegant",
"loiter",
"interactive"
],
"devDependencies": {
"ava": "^1.4.1",
"tsd": "^0.7.2",
"xo": "^0.24.0"
}
}

@@ -7,7 +7,9 @@ # elegant-spinner [![Build Status](https://travis-ci.org/sindresorhus/elegant-spinner.svg?branch=master)](https://travis-ci.org/sindresorhus/elegant-spinner)

**You probably want [`ora`](https://github.com/sindresorhus/ora) instead, which includes this spinner and handles the animation for you.**
## Install
```
$ npm install --save elegant-spinner
$ npm install elegant-spinner
```

@@ -19,7 +21,8 @@

```js
var elegantSpinner = require('elegant-spinner');
var logUpdate = require('log-update');
var frame = elegantSpinner();
const elegantSpinner = require('elegant-spinner');
const logUpdate = require('log-update');
setInterval(function () {
const frame = elegantSpinner();
setInterval(() => {
logUpdate(frame());

@@ -37,2 +40,2 @@ }, 50);

MIT © [Sindre Sorhus](http://sindresorhus.com)
MIT © [Sindre Sorhus](https://sindresorhus.com)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc