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

rollup-plugin-progress

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-progress - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

18

dist/rollup-plugin-progress.esm.js

@@ -1,2 +0,2 @@

import 'fs';
import fs from 'fs';
import path from 'path';

@@ -8,3 +8,3 @@ import chalk from 'chalk';

function normalizePath(id) {
return path.relative(process.cwd(), id).split(path.sep).join('/');
return path.relative(process.cwd(), id).split(path.sep).join('/');
}

@@ -20,3 +20,10 @@

var filter = createFilter(options.include, options.exclude);
var total = 0;
try {
total = fs.readFileSync(totalFilePath);
} catch (e) {
fs.writeFileSync(totalFilePath, 0);
}
var progress = {
total: total,
loaded: 0

@@ -40,3 +47,8 @@ };

process.stdout.cursorTo(0);
var output = "(" + (chalk.red(progress.loaded)) + "): " + file;
var output = "";
if (progress.total > 0) {
var percent = Math.round(100 * progress.loaded / progress.total);
output += Math.min(100, percent) + "% ";
}
output += "(" + (chalk.red(progress.loaded)) + "): " + file;
if (output.length < process.stdout.columns) {

@@ -43,0 +55,0 @@ process.stdout.write(output);

@@ -5,3 +5,3 @@ 'use strict';

var fs = require('fs');
var fs = _interopDefault(require('fs'));
var path = _interopDefault(require('path'));

@@ -13,3 +13,3 @@ var chalk = _interopDefault(require('chalk'));

function normalizePath(id) {
return path.relative(process.cwd(), id).split(path.sep).join('/');
return path.relative(process.cwd(), id).split(path.sep).join('/');
}

@@ -25,3 +25,10 @@

var filter = rollupPluginutils.createFilter(options.include, options.exclude);
var total = 0;
try {
total = fs.readFileSync(totalFilePath);
} catch (e) {
fs.writeFileSync(totalFilePath, 0);
}
var progress = {
total: total,
loaded: 0

@@ -45,3 +52,8 @@ };

process.stdout.cursorTo(0);
var output = "(" + (chalk.red(progress.loaded)) + "): " + file;
var output = "";
if (progress.total > 0) {
var percent = Math.round(100 * progress.loaded / progress.total);
output += Math.min(100, percent) + "% ";
}
output += "(" + (chalk.red(progress.loaded)) + "): " + file;
if (output.length < process.stdout.columns) {

@@ -48,0 +60,0 @@ process.stdout.write(output);

2

package.json
{
"name": "rollup-plugin-progress",
"version": "0.2.1",
"version": "0.3.0",
"description": "Rollup Progress Plugin",

@@ -5,0 +5,0 @@ "main": "dist/rollup-plugin-progress.js",

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