rollup-plugin-progress
Advanced tools
Comparing version 0.0.3 to 0.0.4
import 'fs'; | ||
import path from 'path'; | ||
import chalk from 'chalk'; | ||
import readline from 'readline'; | ||
import { createFilter } from 'rollup-pluginutils'; | ||
@@ -22,2 +23,7 @@ | ||
var rl = readline.createInterface({ | ||
input: process.stdin, | ||
output: process.stdout | ||
}); | ||
return { | ||
@@ -35,10 +41,13 @@ name: 'progress', | ||
if (options.clearLine) { | ||
if (typeof process.stdout.clearLine === 'function') { | ||
process.stdout.clearLine(); | ||
process.stdout.cursorTo(0); | ||
if (options.clearLine && process.stdin.isTTY) { | ||
process.stdout.clearLine(); | ||
process.stdout.cursorTo(0); | ||
var output = "(" + (chalk.red(progress.loaded)) + "): " + (chalk.yellow(file)); | ||
if (output.length < process.stdout.columns) { | ||
process.stdout.write(output); | ||
} else { | ||
process.stdout.write(output.substring(0, process.stdout.columns - 1)); | ||
} | ||
process.stdout.write(("Building (" + (chalk.red(progress.loaded)) + "): " + (chalk.blue(file)))); | ||
} else { | ||
console.log(("Building (" + (chalk.red(progress.loaded)) + "): " + (chalk.yellow(file)))); | ||
console.log(("(" + (chalk.red(progress.loaded)) + "): " + (chalk.yellow(file)))); | ||
} | ||
@@ -48,6 +57,4 @@ }, | ||
if (options.clearLine) { | ||
if (typeof process.stdout.clearLine === 'function') { | ||
process.stdout.clearLine(); | ||
process.stdout.cursorTo(0); | ||
} | ||
process.stdout.clearLine(); | ||
process.stdout.cursorTo(0); | ||
} | ||
@@ -54,0 +61,0 @@ } |
@@ -8,2 +8,3 @@ 'use strict'; | ||
var chalk = _interopDefault(require('chalk')); | ||
var readline = _interopDefault(require('readline')); | ||
var rollupPluginutils = require('rollup-pluginutils'); | ||
@@ -27,2 +28,7 @@ | ||
var rl = readline.createInterface({ | ||
input: process.stdin, | ||
output: process.stdout | ||
}); | ||
return { | ||
@@ -40,10 +46,13 @@ name: 'progress', | ||
if (options.clearLine) { | ||
if (typeof process.stdout.clearLine === 'function') { | ||
process.stdout.clearLine(); | ||
process.stdout.cursorTo(0); | ||
if (options.clearLine && process.stdin.isTTY) { | ||
process.stdout.clearLine(); | ||
process.stdout.cursorTo(0); | ||
var output = "(" + (chalk.red(progress.loaded)) + "): " + (chalk.yellow(file)); | ||
if (output.length < process.stdout.columns) { | ||
process.stdout.write(output); | ||
} else { | ||
process.stdout.write(output.substring(0, process.stdout.columns - 1)); | ||
} | ||
process.stdout.write(("Building (" + (chalk.red(progress.loaded)) + "): " + (chalk.blue(file)))); | ||
} else { | ||
console.log(("Building (" + (chalk.red(progress.loaded)) + "): " + (chalk.yellow(file)))); | ||
console.log(("(" + (chalk.red(progress.loaded)) + "): " + (chalk.yellow(file)))); | ||
} | ||
@@ -53,6 +62,4 @@ }, | ||
if (options.clearLine) { | ||
if (typeof process.stdout.clearLine === 'function') { | ||
process.stdout.clearLine(); | ||
process.stdout.cursorTo(0); | ||
} | ||
process.stdout.clearLine(); | ||
process.stdout.cursorTo(0); | ||
} | ||
@@ -59,0 +66,0 @@ } |
{ | ||
"name": "rollup-plugin-progress", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Rollup Progress Plugin", | ||
@@ -5,0 +5,0 @@ "main": "dist/rollup-plugin-progress.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5828
110