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

wodge

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wodge - npm Package Compare versions

Comparing version 0.1.5 to 0.2.0

2

package.json
{
"name": "wodge",
"version": "0.1.5",
"version": "0.2.0",
"description": "a wodge of functional dough",

@@ -5,0 +5,0 @@ "main": "wodge.js",

@@ -18,62 +18,2 @@ "use strict";

var ansi = {
black: 30,
red: 31,
green: 32,
yellow: 33,
blue: 34,
magenta: 35,
cyan: 36,
white: 37,
bold: 1,
underline: 4
};
var ansiFormat = "\x1b[%sm%s\x1b[0m";
exports.black = function(txt){
return util.format(ansiFormat, ansi.black, txt);
};
exports.red = function(txt){
return util.format(ansiFormat, ansi.red, txt);
};
exports.green = function(txt){
return util.format(ansiFormat, ansi.green, txt);
};
exports.yellow = function(txt){
return util.format(ansiFormat, ansi.yellow, txt);
};
exports.blue = function(txt){
return util.format(ansiFormat, ansi.blue, txt);
};
exports.magenta = function(txt){
return util.format(ansiFormat, ansi.magenta, txt);
};
exports.cyan = function(txt){
return util.format(ansiFormat, ansi.cyan, txt);
};
exports.white = function(txt){
return util.format(ansiFormat, ansi.white, txt);
};
exports.bold = function(txt){
return util.format(ansiFormat, ansi.bold, txt);
};
exports.underline = function(txt){
return util.format(ansiFormat, ansi.underline, txt);
};
/**
Add multiple ansi formats
@method ansi
@example
ansi("hello", "bold", "underline");
ansi("success", "green", "bold");
*/
exports.ansi = function(){
var args = exports.array(arguments),
txt = args.shift(),
codes = args.map(function(arg){ return ansi[arg]; });
return util.format(ansiFormat, codes.join(";"), txt);
};
exports.pluck = function(object, fn){

@@ -131,1 +71,27 @@ var output = [];

}
exports.bytesToSize = function(bytes, precision){
var kilobyte = 1024;
var megabyte = kilobyte * 1024;
var gigabyte = megabyte * 1024;
var terabyte = gigabyte * 1024;
if ((bytes >= 0) && (bytes < kilobyte)) {
return bytes + ' B';
} else if ((bytes >= kilobyte) && (bytes < megabyte)) {
return (bytes / kilobyte).toFixed(precision) + ' KB';
} else if ((bytes >= megabyte) && (bytes < gigabyte)) {
return (bytes / megabyte).toFixed(precision) + ' MB';
} else if ((bytes >= gigabyte) && (bytes < terabyte)) {
return (bytes / gigabyte).toFixed(precision) + ' GB';
} else if (bytes >= terabyte) {
return (bytes / terabyte).toFixed(precision) + ' TB';
} else {
return bytes + ' B';
}
};
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