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

cli-status

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cli-status - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

test.js

12

changelog.md

@@ -1,3 +0,11 @@

### 0.1.0
### [0.1.1](https://github.com/Fishrock123/cli-status/commits/v0.1.1)
* Now tests via `$> npm test`
* All bars are now calculated the same way.
* (!) Fixed bars with a progress of 1 showing a completed bar.
---
### [0.1.0](https://github.com/Fishrock123/cli-status/commits/v0.1.0)
* Initial release.

@@ -10,4 +18,4 @@ * Everything is handled in-module without instances.

* - fn: start(fn:polling)
* - fn: end
* - fn: end()
---

18

index.js

@@ -25,11 +25,11 @@

barCalculator = function(frac) {
barCalculator = function() {
if (progress < 0 || progress > total || isNaN(progress)) return false;
if (ended && progress < total) ended = false;
barLength = Math.floor(length * (frac ? progress / frac : progress));
if (barLength == 0 && progress > 0) barLength = total;
barLength = Math.floor(length * (progress / total));
if (barLength == 0 && progress > 0) barLength = (total >= 10 ? 1 : 0);
return true;
};
checkEnded = function(progress) {
checkEnded = function() {
if (ended || (ended = (progress >= total))) {

@@ -49,7 +49,7 @@ if (stepper) clearInterval(stepper);

stepPercent = function(prog) {
if (progress === prog / total) return;
progress = prog / total;
if (progress === prog) return;
progress = prog;
if (!barCalculator()) return;
process.stdout.write(' ' + prefix + ' [' + makeBar() + '] ' + Math.floor(progress * 100) + '% ' + suffix + checkEnded(prog));
process.stdout.write(' ' + prefix + ' [' + makeBar() + '] ' + Math.floor((progress / total) * 100) + '% ' + suffix + checkEnded());
};

@@ -60,5 +60,5 @@

progress = prog;
if (!barCalculator(total)) return;
if (!barCalculator()) return;
process.stdout.write(' ' + prefix + ' [' + makeBar() + '] ' + progress + '/' + total + ' ' + suffix + checkEnded(progress));
process.stdout.write(' ' + prefix + ' [' + makeBar() + '] ' + progress + '/' + total + ' ' + suffix + checkEnded());
};

@@ -65,0 +65,0 @@

@@ -5,3 +5,3 @@ `cli-status` is distributed under the [MIT License](https://en.wikipedia.org/wiki/MIT_License) which basically means you can do anything you want commercial or private provided you keep the copyright within the source files intact. If you'd like to contribute to the project please [fork](https://github.com/fishrock123/cli-status/fork) and issue a pull request.

Copyright (c) 2013 Jeremiah Senkpiel ("Fishrock123")
Copyright (c) 2013 Jeremiah Senkpiel ("Fishrock123") <fishrock123@rocketmail.com>

@@ -8,0 +8,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

{
"name": "cli-status",
"version": "0.1.0",
"version": "0.1.1",
"description": "Highly configurable status indicators for your node.js cli.",

@@ -11,3 +11,2 @@ "keywords": [

],
"homepage": "https://github.com/fishrock123/cli-status",
"author": {

@@ -29,3 +28,6 @@ "name": "Jeremiah Senkpiel",

},
"scripts" : {
"test": "node test.js"
},
"license": "MIT"
}

@@ -25,3 +25,3 @@ # [cli-status](https://npmjs.org/package/cli-status)

##### Manual stepping:
#### Manual stepping:
```js

@@ -39,3 +39,3 @@ var status = require('cli-status');

##### Automatic polling:
#### Automatic polling:
```js

@@ -64,4 +64,4 @@ var status = require('cli-status');

Clone the repo, then run:
Install or clone the repo, then run:
$> node test.js
$> npm test

Sorry, the diff of this file is not supported yet

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