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

ansi-rainbow

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ansi-rainbow - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

test/ascii.txt

22

index.js

@@ -134,7 +134,9 @@ var ansi = require('ansi-styles')

},
isSpace: function(c) {
return c == ' ' || c.match('\s')
},
isNewLine: function(c) {
return c == '\n'
},
nextColor: function(s, colors) {
//not a space
if(!this.options.color_space && s == ' ') {
return s
}

@@ -162,6 +164,2 @@ var l = colors.length - 1

if(!this.options.color_space && s == ' ') {
return s
}
this._current_gap++

@@ -183,3 +181,9 @@

this._current_gap = this._current_gap > gap ? 1 : this._current_gap
output += this._current_gap == gap ? this.nextColor(input.charAt(i), colors) : this.currentColor(input.charAt(i), colors)
s = input.charAt(i)
if(!this.options.color_space && this.isSpace(s) || this.isNewLine(s)) {
output += s
} else {
output += this._current_gap == gap ? this.nextColor(s, colors) : this.currentColor(s, colors)
}
}

@@ -186,0 +190,0 @@

{
"name": "ansi-rainbow",
"version": "0.0.5",
"version": "0.0.6",
"description": "Ainsi rainbowify",

@@ -8,3 +8,3 @@ "main": "index.js",

"scripts": {
"test": "mocha test.js --reporter spec"
"test": "mocha --reporter spec"
},

@@ -25,4 +25,5 @@ "keywords": [

"mocha": "~1.18.2",
"chalk": "~0.4.0"
"chalk": "~0.4.0",
"through2": "^0.4.1"
}
}

@@ -46,3 +46,3 @@ ansi-rainbow

.skip(rainbow._backgrounds) //skips backgrounds
.add('bgBlue bgMagenta bgCyan')
.add('bgBlue bgMagenta bgCyan') //this will keep order when rainbowified
.options({color_space: true, gap: 3}) //this will force color spaces and change color every 3 characters

@@ -49,0 +49,0 @@

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