File tree Expand file tree Collapse file tree 3 files changed +289
-105
lines changed Expand file tree Collapse file tree 3 files changed +289
-105
lines changed Original file line number Diff line number Diff line change
1
+ const fs = require ( 'fs' ) ;
2
+
3
+ module . exports = JSON . parse ( fs . readFileSync ( 'package.json' , 'utf8' ) ) ;
Original file line number Diff line number Diff line change 1
- 'use strict' ;
2
-
3
1
const readline = require ( 'readline' ) ;
4
2
5
3
/**
6
4
* Adds an animated progress indicator
7
5
*
8
6
* @param {string } message The message to write next to the indicator
9
- * @param {number } amountOfDots The amount of dots you want to animate
7
+ * @param {number } [ amountOfDots=3] The amount of dots you want to animate
10
8
*/
11
- function animateProgress ( message , amountOfDots ) {
12
- if ( typeof amountOfDots !== 'number' ) {
13
- amountOfDots = 3 ;
14
- }
15
-
9
+ function animateProgress ( message , amountOfDots = 3 ) {
16
10
let i = 0 ;
17
- return setInterval ( function ( ) {
11
+ return setInterval ( ( ) => {
18
12
readline . cursorTo ( process . stdout , 0 ) ;
19
13
i = ( i + 1 ) % ( amountOfDots + 1 ) ;
20
14
const dots = new Array ( i + 1 ) . join ( '.' ) ;
You can’t perform that action at this time.
0 commit comments