mirror of
https://github.com/musix-org/musix-oss
synced 2025-06-17 01:16:00 +00:00
Modules
This commit is contained in:
3
node_modules/colour/.npmignore
generated
vendored
Normal file
3
node_modules/colour/.npmignore
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
node_modules/
|
||||
npm-debug.log
|
||||
.idea/
|
20
node_modules/colour/LICENSE
generated
vendored
Normal file
20
node_modules/colour/LICENSE
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
Copyright (c) 2010 Marak Squires, Alexis Sellier (cloudhead)
|
||||
Copyright (c) 2013 Daniel Wirtz <dcode@dcode.io>
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
101
node_modules/colour/README.md
generated
vendored
Normal file
101
node_modules/colour/README.md
generated
vendored
Normal file
@ -0,0 +1,101 @@
|
||||

|
||||
===========
|
||||
A cored, fixed, documented and optimized version of the popular [colors.js](https://github.com/Marak/colors.js). Can be
|
||||
used as a drop-in replacement, also works correctly in the browser, provides a CSS mode and has been compiled through
|
||||
Closure Compiler using advanced optimizations. Additionally, nearly every issue and pull request on the original has
|
||||
been incorporated.
|
||||
|
||||
Installation
|
||||
------------
|
||||
`npm install colour`
|
||||
|
||||
Usage
|
||||
-----
|
||||
This package extends the global String prototype with additional getters that apply terminal colors to your texts.
|
||||
Available styles are:
|
||||
|
||||
* **Emphasis:** bold, italic, underline, inverse
|
||||
* **Colors:** yellow, cyan, white, magenta, green, red, grey, blue
|
||||
* **Sequencers:** rainbow, zebra, random
|
||||
|
||||
#### Example
|
||||
|
||||
```js
|
||||
var colour = require('colour');
|
||||
console.log('hello'.green); // outputs green text
|
||||
console.log('i like cake and pies'.underline.red) // outputs red underlined text
|
||||
console.log('inverse the color'.inverse); // inverses the color
|
||||
console.log('OMG Rainbows!'.rainbow); // rainbow (ignores spaces)
|
||||
```
|
||||
|
||||
#### Or: As a drop-in replacement for `colors`
|
||||
```js
|
||||
var /* just name it */ colors = require('colour');
|
||||
...
|
||||
```
|
||||
|
||||
Custom themes
|
||||
-------------
|
||||
Its also possible to define your own themes by creating new getters on the String object. Example:
|
||||
|
||||
```js
|
||||
var colour = require('colour');
|
||||
colour.setTheme({
|
||||
silly: 'rainbow',
|
||||
input: 'grey',
|
||||
verbose: 'cyan',
|
||||
prompt: 'grey',
|
||||
info: 'green',
|
||||
data: 'grey',
|
||||
help: 'cyan',
|
||||
warn: ['yellow', 'underline'], // Applies two styles at once
|
||||
debug: 'blue',
|
||||
error: 'red bold' // Again, two styles
|
||||
});
|
||||
|
||||
console.log("this is an error".error); // outputs bold red text
|
||||
console.log("this is a warning".warn); // outputs underlined yellow text
|
||||
|
||||
console.log(colour.green("this is green")); // Alternatively
|
||||
```
|
||||
|
||||
Console, browser and browser-css mode
|
||||
-------------------------------------
|
||||
```js
|
||||
var colour = require('colour');
|
||||
...
|
||||
colour.mode = 'none'; // No colors at all
|
||||
colour.mode = 'console'; // Adds terminal colors (default on node.js)
|
||||
colour.mode = 'browser'; // Adds HTML colors (default in browsers)
|
||||
colour.mode = 'browser-css'; // Adds special CSS (see examples/example.css)
|
||||
```
|
||||
|
||||
Uninstalling / reinstalling on the global scope
|
||||
-----------------------------------------------
|
||||
If you have a reason to use a fresh String prototype in your application, you may also revert all extensions made.
|
||||
|
||||
```js
|
||||
var colour = require('colour');
|
||||
...
|
||||
colour.uninstall(); // Removes all custom properties from the String prototype
|
||||
...
|
||||
colour.install(); // Re-installs them
|
||||
...
|
||||
```
|
||||
|
||||
More features
|
||||
-------------
|
||||
* node.js/CommonJS compatible
|
||||
* RequireJS/AMD compatible
|
||||
* Browser/shim compatible
|
||||
* Closure Compiler [externs included](https://github.com/dcodeIO/colour.js/blob/master/externs/colour.js)
|
||||
* Zero dependencies
|
||||
|
||||
Credits
|
||||
-------
|
||||
Based on work started by Marak (Marak Squires), cloudhead (Alexis Sellier), mmalecki (Maciej Małecki), nicoreed (Nico
|
||||
Reed), morganrallen (Morgan Allen), JustinCampbell (Justin Campbell) and ded (Dustin Diaz).
|
||||
|
||||
License
|
||||
-------
|
||||
The MIT-License (MIT)
|
335
node_modules/colour/colour.js
generated
vendored
Normal file
335
node_modules/colour/colour.js
generated
vendored
Normal file
@ -0,0 +1,335 @@
|
||||
/*
|
||||
Copyright (c) 2010 Marak Squires, Alexis Sellier (cloudhead)
|
||||
Copyright (c) 2013 Daniel Wirtz <dcode@dcode.io>
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
/**
|
||||
* @license colour.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
|
||||
* Released under the MIT-License
|
||||
* see: https://github.com/dcodeIO/colour.js for details
|
||||
*/
|
||||
(function (global) { // #22
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* colour namespace.
|
||||
* @namespace
|
||||
*/
|
||||
var colour = {};
|
||||
|
||||
/**
|
||||
* Colour mode. To generate html in node, use colour.setTheme("html") instead.
|
||||
* @type {string} May be "console", "browser" or "none".
|
||||
* @expose
|
||||
*/
|
||||
colour.mode = "console";
|
||||
|
||||
/**
|
||||
* Whether running in a headless environment like node.js or not.
|
||||
* @type {boolean}
|
||||
* @expose
|
||||
*/
|
||||
colour.headless = typeof global['window'] === 'undefined';
|
||||
|
||||
/**
|
||||
* All themes we know about. Contains only the "default" theme by default.
|
||||
* @type {!Object.<string,!Object>}
|
||||
* @expose
|
||||
*/
|
||||
colour.themes = {};
|
||||
|
||||
/**
|
||||
* Terminal colours.
|
||||
* @type {!Object} Hello Closure
|
||||
*/
|
||||
var consoleStyles = {
|
||||
'bold': ['\x1B[1m', '\x1B[22m'],
|
||||
'italic': ['\x1B[3m', '\x1B[23m'],
|
||||
'underline': ['\x1B[4m', '\x1B[24m'],
|
||||
'inverse': ['\x1B[7m', '\x1B[27m'],
|
||||
'strikethrough': ['\x1B[9m', '\x1B[29m'],
|
||||
'white': ['\x1B[37m', '\x1B[39m'],
|
||||
'gray': ['\x1B[90m', '\x1B[39m'],
|
||||
'grey': ['\x1B[90m', '\x1B[39m'],
|
||||
'black': ['\x1B[30m', '\x1B[39m'],
|
||||
'blue': ['\x1B[34m', '\x1B[39m'],
|
||||
'cyan': ['\x1B[36m', '\x1B[39m'],
|
||||
'green': ['\x1B[32m', '\x1B[39m'],
|
||||
'magenta': ['\x1B[35m', '\x1B[39m'],
|
||||
'red': ['\x1B[31m', '\x1B[39m'],
|
||||
'yellow': ['\x1B[33m', '\x1B[39m']
|
||||
};
|
||||
|
||||
/**
|
||||
* HTML.
|
||||
* @type {!Object.<string,Array.<string>>}
|
||||
*/
|
||||
var browserStyles = {
|
||||
'bold' : ['<b>', '</b>'],
|
||||
'italic' : ['<i>', '</i>'],
|
||||
'underline' : ['<u>', '</u>'],
|
||||
'inverse' : ['<span style="background-color:black;color:white;">', '</span>'],
|
||||
'strikethrough' : ['<del>', '</del>'],
|
||||
'white' : ['<span style="color:white;">', '</span>'],
|
||||
'gray' : ['<span style="color:gray;">', '</span>'], // #46
|
||||
'grey' : ['<span style="color:grey;">', '</span>'], // Let the user decide
|
||||
'black' : ['<span style="color:black;">', '</span>'],
|
||||
'blue' : ['<span style="color:blue;">', '</span>'],
|
||||
'cyan' : ['<span style="color:cyan;">', '</span>'],
|
||||
'green' : ['<span style="color:green;">', '</span>'],
|
||||
'magenta' : ['<span style="color:magenta;">', '</span>'],
|
||||
'red' : ['<span style="color:red;">', '</span>'],
|
||||
'yellow' : ['<span style="color:yellow;">', '</span>']
|
||||
};
|
||||
|
||||
/**
|
||||
* CSS.
|
||||
* @type {!Object.<string,Array.<string>>}
|
||||
*/
|
||||
var cssStyles = { // #39
|
||||
'bold' : ['<span class="ansi-escape ansi-escape-bold">', '</span>'],
|
||||
'italic' : ['<span class="ansi-escape ansi-escape-italic">', '</span>'],
|
||||
'underline' : ['<span class="ansi-escape ansi-escape-underline">', '</span>'],
|
||||
'inverse' : ['<span class="ansi-escape ansi-escape-inverse">', '</span>'],
|
||||
'strikethrough' : ['<span class="ansi-escape ansi-escape-strikethrough">', '</span>'],
|
||||
'white' : ['<span class="ansi-escape ansi-escape-white">', '</span>'],
|
||||
'gray' : ['<span class="ansi-escape ansi-escape-gray">', '</span>'],
|
||||
'grey' : ['<span class="ansi-escape ansi-escape-grey">', '</span>'],
|
||||
'black' : ['<span class="ansi-escape ansi-escape-black">', '</span>'],
|
||||
'blue' : ['<span class="ansi-escape ansi-escape-blue">', '</span>'],
|
||||
'cyan' : ['<span class="ansi-escape ansi-escape-cyan">', '</span>'],
|
||||
'green' : ['<span class="ansi-escape ansi-escape-green">', '</span>'],
|
||||
'magenta' : ['<span class="ansi-escape ansi-escape-magenta">', '</span>'],
|
||||
'red' : ['<span class="ansi-escape ansi-escape-red">', '</span>'],
|
||||
'yellow' : ['<span class="ansi-escape ansi-escape-yellow">', '</span>']
|
||||
};
|
||||
|
||||
/**
|
||||
* Remember all getters that we defined.
|
||||
* @type {!Object}
|
||||
*/
|
||||
var definedGetters = {};
|
||||
|
||||
/**
|
||||
* Prototypes the string object to have additional properties that wraps the current string in colours when accessed.
|
||||
* @param {string} col Colour / property name
|
||||
* @param {function(string):string} func Wrapper function
|
||||
* @private
|
||||
*/
|
||||
function addProperty(col, func) {
|
||||
// Exposed on top of the namespace
|
||||
colour[col] = function(str) {
|
||||
return func.apply(str);
|
||||
};
|
||||
// And on top of all strings
|
||||
try {
|
||||
String.prototype.__defineGetter__(col, func);
|
||||
definedGetters[col] = func;
|
||||
} catch (e) {} // #25
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether colour are currently installed on the global scope.
|
||||
* @type {boolean}
|
||||
* @private
|
||||
**/
|
||||
var installed = true;
|
||||
|
||||
/**
|
||||
* Uninstalls colour from the global scope.
|
||||
* @returns {boolean} true if successfully uninstalled, false if already uninstalled
|
||||
* @expose
|
||||
*/
|
||||
colour.uninstall = function() { // #41
|
||||
if (installed) {
|
||||
Object.keys(definedGetters).forEach(function(color) {
|
||||
try {
|
||||
String.prototype.__defineGetter__(color, null);
|
||||
} catch (e) {
|
||||
delete String.prototype[color];
|
||||
}
|
||||
});
|
||||
installed = false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Reinstalls colour on the global scope.
|
||||
* @returns {boolean} true if successfully reinstalled, false if already installed
|
||||
* @expose
|
||||
*/
|
||||
colour.install = function() {
|
||||
if (!installed) {
|
||||
Object.keys(definedGetters).forEach(function(color) {
|
||||
String.prototype.__defineGetter__(color, definedGetters[color]);
|
||||
});
|
||||
installed = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Applies a style to a string.
|
||||
* @param {string} str String to stylize
|
||||
* @param {string} style Style to apply
|
||||
* @returns {string}
|
||||
* @private
|
||||
*/
|
||||
function stylize(str, style) {
|
||||
if (colour.mode == 'console') {
|
||||
return consoleStyles[style][0] + str + consoleStyles[style][1];
|
||||
} else if (colour.mode == 'browser') {
|
||||
return browserStyles[style][0] + str + browserStyles[style][1];
|
||||
} else if (colour.mode == 'browser-css') {
|
||||
return cssStyles[style][0] + str + browserStyles[style][1];
|
||||
}
|
||||
return str+'';
|
||||
}
|
||||
|
||||
/**
|
||||
* Rainbow colours.
|
||||
* @type {!Array.<string>}
|
||||
* @const
|
||||
* @private
|
||||
*/
|
||||
var rainbowColours = ['red', 'yellow', 'green', 'blue', 'magenta'];
|
||||
|
||||
/**
|
||||
* String properties that should never be overwritten.
|
||||
* @type {!Array.<string>}
|
||||
* @const
|
||||
*/
|
||||
var prototypeBlacklist = [
|
||||
'__defineGetter__', '__defineSetter__', '__lookupGetter__', '__lookupSetter__', 'charAt', 'constructor',
|
||||
'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf', 'charCodeAt',
|
||||
'indexOf', 'lastIndexof', 'length', 'localeCompare', 'match', 'replace', 'search', 'slice', 'split', 'substring',
|
||||
'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toUpperCase', 'trim', 'trimLeft', 'trimRight'
|
||||
];
|
||||
|
||||
/**
|
||||
* Applies a theme.
|
||||
* @param {!Object} theme Theme to apply
|
||||
*/
|
||||
function applyTheme(theme) {
|
||||
Object.keys(theme).forEach(function(prop) {
|
||||
if (prototypeBlacklist.indexOf(prop) >= 0) {
|
||||
return;
|
||||
}
|
||||
if (typeof theme[prop] == 'string') {
|
||||
// Multiple colours white-space seperated #45, e.g. "red bold", #18
|
||||
theme[prop] = theme[prop].split(' ');
|
||||
}
|
||||
addProperty(prop, function () {
|
||||
var ret = this;
|
||||
for (var t=0; t<theme[prop].length; t++) {
|
||||
ret = colour[theme[prop][t]](ret);
|
||||
}
|
||||
return ret;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets another theme.
|
||||
* @param {string|!Object} theme Theme name or
|
||||
* @returns {!Object|!Error|undefined}
|
||||
* @expose
|
||||
*/
|
||||
colour.setTheme = function(theme) {
|
||||
if (typeof theme === 'string') {
|
||||
if (typeof colour.themes[theme] != 'undefined') {
|
||||
applyTheme(colour.themes[theme]);
|
||||
return colour.themes[theme];
|
||||
}
|
||||
/* else */ try /* to load it */ {
|
||||
colour.themes[theme] = require(theme);
|
||||
applyTheme(colour.themes[theme]);
|
||||
return colour.themes[theme];
|
||||
} catch (err) {
|
||||
return err;
|
||||
}
|
||||
} else {
|
||||
applyTheme(theme);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Extends a mapper with the current index inside the string as a second argument.
|
||||
* @param {function(string, number):string} map Sequencing function
|
||||
* @returns {function(string):string} Wrapped sequencer
|
||||
* @private
|
||||
*/
|
||||
function sequencer(map) {
|
||||
return function () {
|
||||
if (this == undefined) return "";
|
||||
var i=0;
|
||||
return String.prototype.split.apply(this, [""]).map(map).join("");
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a sequencer that generates output depending on the index inside a string.
|
||||
* @param {string} name Sequencer name
|
||||
* @param {function(string, number):string} map Mapping function called for every character as the first and the
|
||||
* current index of that character as the second argument.
|
||||
* @expose
|
||||
*/
|
||||
colour.addSequencer = function (name, map) {
|
||||
addProperty(name, sequencer(map));
|
||||
};
|
||||
|
||||
// Apply defaults
|
||||
Object.keys(consoleStyles).forEach(
|
||||
function (style) {
|
||||
addProperty(style, function () {
|
||||
return stylize(this, style);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
colour.addSequencer('rainbow', function(letter, i) {
|
||||
return letter === " " ? letter : stylize(letter, rainbowColours[i++ % rainbowColours.length]);
|
||||
});
|
||||
colour.addSequencer('zebra', sequencer(function (letter, i) {
|
||||
return i % 2 === 0 ? letter : letter.inverse;
|
||||
}));
|
||||
|
||||
function strip() {
|
||||
return this.replace(/\x1B\[\d+m/g, '')
|
||||
.replace(/<\/?(?:span|u|i|u|del)\b[^>]*>/g, '');
|
||||
}
|
||||
|
||||
addProperty('strip', strip);
|
||||
addProperty('stripColors', strip); // Compatibility
|
||||
|
||||
if (typeof module !== 'undefined' && module['exports']) {
|
||||
module.exports = colour;
|
||||
} else if (typeof define !== 'undefined' && define.amd) {
|
||||
define("colour", function() { return colour; });
|
||||
define("colors", function() { return colour; });
|
||||
} else {
|
||||
colour.mode = 'browser';
|
||||
global['colour'] = global['colors'] = colour;
|
||||
}
|
||||
|
||||
})(this);
|
14
node_modules/colour/colour.min.js
generated
vendored
Normal file
14
node_modules/colour/colour.min.js
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
/*
|
||||
colour.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
|
||||
Released under the MIT-License
|
||||
see: https://github.com/dcodeIO/colour.js for details
|
||||
*/
|
||||
(function(g){function d(a,b){c[a]=function(a){return b.apply(a)};try{String.prototype.__defineGetter__(a,b),e[a]=b}catch(d){}}function m(a,b){return"console"==c.mode?h[b][0]+a+h[b][1]:"browser"==c.mode?k[b][0]+a+k[b][1]:"browser-css"==c.mode?r[b][0]+a+k[b][1]:a+""}function l(a){Object.keys(a).forEach(function(b){0<=s.indexOf(b)||("string"==typeof a[b]&&(a[b]=a[b].split(" ")),d(b,function(){for(var d=this,e=0;e<a[b].length;e++)d=c[a[b][e]](d);return d}))})}function n(a){return function(){return void 0==
|
||||
this?"":String.prototype.split.apply(this,[""]).map(a).join("")}}function p(){return this.replace(/\x1B\[\d+m/g,"").replace(/<\/?(?:span|u|i|u|del)\b[^>]*>/g,"")}var c={mode:"console"};c.headless="undefined"===typeof g.window;c.themes={};var h={bold:["\u001b[1m","\u001b[22m"],italic:["\u001b[3m","\u001b[23m"],underline:["\u001b[4m","\u001b[24m"],inverse:["\u001b[7m","\u001b[27m"],strikethrough:["\u001b[9m","\u001b[29m"],white:["\u001b[37m","\u001b[39m"],gray:["\u001b[90m","\u001b[39m"],grey:["\u001b[90m",
|
||||
"\u001b[39m"],black:["\u001b[30m","\u001b[39m"],blue:["\u001b[34m","\u001b[39m"],cyan:["\u001b[36m","\u001b[39m"],green:["\u001b[32m","\u001b[39m"],magenta:["\u001b[35m","\u001b[39m"],red:["\u001b[31m","\u001b[39m"],yellow:["\u001b[33m","\u001b[39m"]},k={bold:["<b>","</b>"],italic:["<i>","</i>"],underline:["<u>","</u>"],inverse:['<span style="background-color:black;color:white;">',"</span>"],strikethrough:["<del>","</del>"],white:['<span style="color:white;">',"</span>"],gray:['<span style="color:gray;">',
|
||||
"</span>"],grey:['<span style="color:grey;">',"</span>"],black:['<span style="color:black;">',"</span>"],blue:['<span style="color:blue;">',"</span>"],cyan:['<span style="color:cyan;">',"</span>"],green:['<span style="color:green;">',"</span>"],magenta:['<span style="color:magenta;">',"</span>"],red:['<span style="color:red;">',"</span>"],yellow:['<span style="color:yellow;">',"</span>"]},r={bold:['<span class="ansi-escape ansi-escape-bold">',"</span>"],italic:['<span class="ansi-escape ansi-escape-italic">',
|
||||
"</span>"],underline:['<span class="ansi-escape ansi-escape-underline">',"</span>"],inverse:['<span class="ansi-escape ansi-escape-inverse">',"</span>"],strikethrough:['<span class="ansi-escape ansi-escape-strikethrough">',"</span>"],white:['<span class="ansi-escape ansi-escape-white">',"</span>"],gray:['<span class="ansi-escape ansi-escape-gray">',"</span>"],grey:['<span class="ansi-escape ansi-escape-grey">',"</span>"],black:['<span class="ansi-escape ansi-escape-black">',"</span>"],blue:['<span class="ansi-escape ansi-escape-blue">',
|
||||
"</span>"],cyan:['<span class="ansi-escape ansi-escape-cyan">',"</span>"],green:['<span class="ansi-escape ansi-escape-green">',"</span>"],magenta:['<span class="ansi-escape ansi-escape-magenta">',"</span>"],red:['<span class="ansi-escape ansi-escape-red">',"</span>"],yellow:['<span class="ansi-escape ansi-escape-yellow">',"</span>"]},e={},f=!0;c.uninstall=function(){return f?(Object.keys(e).forEach(function(a){try{String.prototype.__defineGetter__(a,null)}catch(b){delete String.prototype[a]}}),f=
|
||||
!1,!0):!1};c.install=function(){return!f?(Object.keys(e).forEach(function(a){String.prototype.__defineGetter__(a,e[a])}),f=!0):!1};var q=["red","yellow","green","blue","magenta"],s="__defineGetter__ __defineSetter__ __lookupGetter__ __lookupSetter__ charAt constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf charCodeAt indexOf lastIndexof length localeCompare match replace search slice split substring toLocaleLowerCase toLocaleUpperCase toLowerCase toUpperCase trim trimLeft trimRight".split(" ");
|
||||
c.setTheme=function(a){if("string"===typeof a){if("undefined"!=typeof c.themes[a])return l(c.themes[a]),c.themes[a];try{return c.themes[a]=require(a),l(c.themes[a]),c.themes[a]}catch(b){return b}}else l(a)};c.addSequencer=function(a,b){d(a,n(b))};Object.keys(h).forEach(function(a){d(a,function(){return m(this,a)})});c.addSequencer("rainbow",function(a,b){return" "===a?a:m(a,q[b++%q.length])});c.addSequencer("zebra",n(function(a,b){return 0===b%2?a:a.inverse}));d("strip",p);d("stripColors",p);"undefined"!==
|
||||
typeof module&&module.exports?module.exports=c:"undefined"!==typeof define&&define.amd?(define("colour",function(){return c}),define("colors",function(){return c})):(c.mode="browser",g.colour=g.colors=c)})(this);
|
BIN
node_modules/colour/colour.png
generated
vendored
Normal file
BIN
node_modules/colour/colour.png
generated
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.2 KiB |
25
node_modules/colour/examples/example.css
generated
vendored
Normal file
25
node_modules/colour/examples/example.css
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
/* reset */
|
||||
span.ansi-escape {
|
||||
color: #000;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* styles */
|
||||
span.ansi-escape.ansi-escape-bold { font-weight: bold; }
|
||||
span.ansi-escape.ansi-escape-italic { font-style: italic; }
|
||||
span.ansi-escape.ansi-escape-underline { text-decoration: underline; }
|
||||
span.ansi-escape.ansi-escape-inverse { color: #FFF; background: #000; }
|
||||
span.ansi-escape.ansi-escape-strikethrough { text-decoration: line-through; }
|
||||
|
||||
/* greyscale */
|
||||
span.ansi-escape.ansi-escape-white { color: #FFF; }
|
||||
span.ansi-escape.ansi-escape-grey { color: #7F7F7F; }
|
||||
span.ansi-escape.ansi-escape-black { color: #000; }
|
||||
|
||||
/* colors */
|
||||
span.ansi-escape.ansi-escape-blue { color: #00F; }
|
||||
span.ansi-escape.ansi-escape-cyan { color: #0FF; }
|
||||
span.ansi-escape.ansi-escape-green { color: #0F0; }
|
||||
span.ansi-escape.ansi-escape-magenta { color: #F0F; }
|
||||
span.ansi-escape.ansi-escape-red { color: #F00; }
|
||||
span.ansi-escape.ansi-escape-yellow { color: #FF0; }
|
91
node_modules/colour/examples/example.html
generated
vendored
Normal file
91
node_modules/colour/examples/example.html
generated
vendored
Normal file
@ -0,0 +1,91 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en-us">
|
||||
<head>
|
||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
||||
<title>Colors Example</title>
|
||||
<script src="../colors.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="example.css" />
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
var test = colors.red("hopefully colorless output");
|
||||
|
||||
document.write('Rainbows are fun!'.rainbow + '<br/>');
|
||||
document.write('So '.italic + 'are'.underline + ' styles! '.bold + 'inverse'.inverse); // styles not widely supported
|
||||
document.write('Chains are also cool.'.bold.italic.underline.red); // styles not widely supported
|
||||
//document.write('zalgo time!'.zalgo);
|
||||
document.write(test.stripColors);
|
||||
document.write("a".grey + " b".black);
|
||||
|
||||
document.write("Zebras are so fun!".zebra);
|
||||
|
||||
document.write(colors.rainbow('Rainbows are fun!'));
|
||||
document.write("This is " + "not".strikethrough + " fun.");
|
||||
|
||||
document.write(colors.italic('So ') + colors.underline('are') + colors.bold(' styles! ') + colors.inverse('inverse')); // styles not widely supported
|
||||
document.write(colors.bold(colors.italic(colors.underline(colors.red('Chains are also cool.'))))); // styles not widely supported
|
||||
//document.write(colors.zalgo('zalgo time!'));
|
||||
document.write(colors.stripColors(test));
|
||||
document.write(colors.grey("a") + colors.black(" b"));
|
||||
|
||||
colors.addSequencer("america", function(letter, i, exploded) {
|
||||
if(letter === " ") return letter;
|
||||
switch(i%3) {
|
||||
case 0: return letter.red;
|
||||
case 1: return letter.white;
|
||||
case 2: return letter.blue;
|
||||
}
|
||||
});
|
||||
|
||||
colors.addSequencer("random", (function() {
|
||||
var available = ['bold', 'underline', 'italic', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta'];
|
||||
|
||||
return function(letter, i, exploded) {
|
||||
return letter === " " ? letter : letter[available[Math.round(Math.random() * (available.length - 1))]];
|
||||
};
|
||||
})());
|
||||
|
||||
document.write("AMERICA! F--K YEAH!".america);
|
||||
document.write("So apparently I've been to Mars, with all the little green men. But you know, I don't recall.".random);
|
||||
|
||||
//
|
||||
// Custom themes
|
||||
//
|
||||
|
||||
colors.setTheme({
|
||||
silly: 'rainbow',
|
||||
input: 'grey',
|
||||
verbose: 'cyan',
|
||||
prompt: 'grey',
|
||||
info: 'green',
|
||||
data: 'grey',
|
||||
help: 'cyan',
|
||||
warn: 'yellow',
|
||||
debug: 'blue',
|
||||
error: 'red'
|
||||
});
|
||||
|
||||
// outputs red text
|
||||
document.write("this is an error".error);
|
||||
|
||||
// outputs yellow text
|
||||
document.write("this is a warning".warn);
|
||||
|
||||
//
|
||||
// Using CSS classes
|
||||
//
|
||||
|
||||
colors.mode = "browser-css";
|
||||
|
||||
var stylesColors = ['white', 'grey', 'black', 'blue', 'cyan', 'green', 'magenta', 'red', 'yellow'];
|
||||
var stylesNormal = stylesColors.concat(['bold', 'italic', 'underline', 'inverse']);
|
||||
|
||||
stylesNormal.forEach(function (style) {
|
||||
var string = "Im feeling rather " + style + " today.";
|
||||
document.write(string[style] + "<br>");
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
71
node_modules/colour/examples/example.js
generated
vendored
Normal file
71
node_modules/colour/examples/example.js
generated
vendored
Normal file
@ -0,0 +1,71 @@
|
||||
var colors = require('./../colour');
|
||||
|
||||
//colors.mode = "browser";
|
||||
|
||||
var test = colors.red("hopefully colorless output");
|
||||
console.log('Rainbows are fun!'.rainbow);
|
||||
console.log('So '.italic + 'are'.underline + ' styles! '.bold + 'inverse'.inverse); // styles not widely supported
|
||||
console.log('Chains are also cool.'.bold.italic.underline.red); // styles not widely supported
|
||||
//console.log('zalgo time!'.zalgo);
|
||||
console.log(test.stripColors);
|
||||
console.log("a".grey + " b".black);
|
||||
|
||||
console.log("Zebras are so fun!".zebra);
|
||||
|
||||
//
|
||||
// Remark: .strikethrough may not work with Mac OS Terminal App
|
||||
//
|
||||
console.log("This is " + "not".strikethrough + " fun.");
|
||||
console.log(colors.rainbow('Rainbows are fun!'));
|
||||
console.log(colors.italic('So ') + colors.underline('are') + colors.bold(' styles! ') + colors.inverse('inverse')); // styles not widely supported
|
||||
console.log(colors.bold(colors.italic(colors.underline(colors.red('Chains are also cool.'))))); // styles not widely supported
|
||||
//console.log(colors.zalgo('zalgo time!'));
|
||||
console.log(colors.stripColors(test));
|
||||
// console.log(colors.grey("a") + colors.black(" b"));
|
||||
|
||||
colors.addSequencer("america", function(letter, i, exploded) {
|
||||
if(letter === " ") return letter;
|
||||
switch(i%3) {
|
||||
case 0: return letter.red;
|
||||
case 1: return letter.white;
|
||||
case 2: return letter.blue;
|
||||
}
|
||||
});
|
||||
|
||||
colors.addSequencer("random", (function() {
|
||||
var available = ['bold', 'underline', 'italic', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta'];
|
||||
|
||||
return function(letter, i, exploded) {
|
||||
return letter === " " ? letter : letter[available[Math.round(Math.random() * (available.length - 1))]];
|
||||
};
|
||||
})());
|
||||
|
||||
console.log("AMERICA! F--K YEAH!".america);
|
||||
console.log("So apparently I've been to Mars, with all the little green men. But you know, I don't recall.".random);
|
||||
|
||||
//
|
||||
// Custom themes
|
||||
//
|
||||
|
||||
// Load theme with JSON literal
|
||||
colors.setTheme({
|
||||
silly: 'rainbow',
|
||||
input: 'grey',
|
||||
verbose: 'cyan',
|
||||
prompt: 'grey',
|
||||
info: 'green',
|
||||
data: 'grey',
|
||||
help: 'cyan',
|
||||
warn: 'yellow',
|
||||
debug: 'blue',
|
||||
error: 'red'
|
||||
});
|
||||
|
||||
// outputs red text
|
||||
console.log("this is an error".error);
|
||||
|
||||
// outputs yellow text
|
||||
console.log("this is a warning".warn);
|
||||
|
||||
// outputs grey text
|
||||
console.log("this is an input".input);
|
136
node_modules/colour/externs/colour.js
generated
vendored
Normal file
136
node_modules/colour/externs/colour.js
generated
vendored
Normal file
@ -0,0 +1,136 @@
|
||||
/*
|
||||
* Copyright 2012 The Closure Compiler Authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileoverview Definitions for colour.js.
|
||||
* @externs
|
||||
* @author Daniel Wirtz <dcode@dcode.io>
|
||||
*/
|
||||
var colour = function() {};
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
colour.mode;
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
colour.headless;
|
||||
|
||||
/**
|
||||
* @param {string} str
|
||||
* @returns {function(this:String)}
|
||||
*/
|
||||
colour.color = function(str) {};
|
||||
|
||||
/**
|
||||
* @type {Object.<string,Object.<string,*>>}
|
||||
*/
|
||||
colour.themes;
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
* @param {function(string):string} map
|
||||
*/
|
||||
colour.addSequencer = function(name, map) {};
|
||||
|
||||
/**
|
||||
* @param {Object.<string,*>} theme
|
||||
* @returns {Object.<string,*>|Error|undefined}
|
||||
*/
|
||||
colour.setTheme = function (theme) {};
|
||||
|
||||
/**
|
||||
* @returns {boolean}
|
||||
*/
|
||||
colour.uninstall = function() {};
|
||||
|
||||
/**
|
||||
* @returns {boolean}
|
||||
*/
|
||||
colour.install = function() {};
|
||||
|
||||
/**
|
||||
* @name String.prototype.bold
|
||||
* @type {string}
|
||||
*/
|
||||
// String.prototype.bold;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
String.prototype.italic;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
String.prototype.underline;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
String.prototype.inverse;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
String.prototype.strikethrough;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
String.prototype.white;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
String.prototype.grey;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
String.prototype.black;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
String.prototype.blue;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
String.prototype.cyan;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
String.prototype.green;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
String.prototype.magenta;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
String.prototype.red;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
String.prototype.yellow;
|
37
node_modules/colour/externs/minimal-env.js
generated
vendored
Normal file
37
node_modules/colour/externs/minimal-env.js
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
/**
|
||||
* @fileoverview Minimal environment to compile colour.js.
|
||||
* @externs
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param {string} moduleName
|
||||
* @returns {!Object}
|
||||
*/
|
||||
var require = function(moduleName) {};
|
||||
|
||||
/**
|
||||
* @type {Module}
|
||||
*/
|
||||
var module;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
var Module = function() {};
|
||||
|
||||
/**
|
||||
* @type {*}
|
||||
*/
|
||||
Module.prototype.exports;
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
* @param {function()} contructor
|
||||
*/
|
||||
var define = function(name, contructor) {};
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
define.amd;
|
61
node_modules/colour/package.json
generated
vendored
Normal file
61
node_modules/colour/package.json
generated
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"colour@0.7.1",
|
||||
"C:\\Users\\matia\\Musix"
|
||||
]
|
||||
],
|
||||
"_from": "colour@0.7.1",
|
||||
"_id": "colour@0.7.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g=",
|
||||
"_location": "/colour",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "colour@0.7.1",
|
||||
"name": "colour",
|
||||
"escapedName": "colour",
|
||||
"rawSpec": "0.7.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "0.7.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/ascli"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/colour/-/colour-0.7.1.tgz",
|
||||
"_spec": "0.7.1",
|
||||
"_where": "C:\\Users\\matia\\Musix",
|
||||
"author": {
|
||||
"name": "Daniel Wirtz",
|
||||
"email": "dcode@dcode.io"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/dcodeIO/colour.js/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "A cored, fixed, documented and optimized version of the popular `colors.js`: Get colors in your node.js console like what...",
|
||||
"devDependencies": {},
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
},
|
||||
"homepage": "https://github.com/dcodeIO/colour.js#readme",
|
||||
"keywords": [
|
||||
"ansi",
|
||||
"terminal",
|
||||
"colors"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./colour.min.js",
|
||||
"name": "colour",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/dcodeIO/colour.js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"compile": "ccjs colour.js --warning_level=VERBOSE --compilation_level=ADVANCED_OPTIMIZATIONS --externs=externs > colour.min.js",
|
||||
"test": "node tests/test.js"
|
||||
},
|
||||
"version": "0.7.1"
|
||||
}
|
80
node_modules/colour/tests/test.js
generated
vendored
Normal file
80
node_modules/colour/tests/test.js
generated
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
var assert = require("assert"),
|
||||
path = require("path"),
|
||||
/* let's name it */ colors = require(path.join(__dirname, '..', 'colour.min.js'));
|
||||
|
||||
var s = 'string';
|
||||
|
||||
function a(s, code) {
|
||||
return '\x1B[' + code.toString() + 'm' + s + '\x1B[39m';
|
||||
}
|
||||
|
||||
function aE(s, color, code) {
|
||||
assert.equal(s[color], a(s, code));
|
||||
assert.equal(colors[color](s), a(s, code));
|
||||
assert.equal(s[color], colors[color](s));
|
||||
assert.equal(s[color].stripColors, s);
|
||||
assert.equal(s[color].stripColors, colors.stripColors(s));
|
||||
}
|
||||
|
||||
function h(s, color) {
|
||||
return '<span style="color:' + color + ';">' + s + '</span>';
|
||||
// that's pretty dumb approach to testing it
|
||||
}
|
||||
|
||||
var stylesColors = ['white', 'grey', 'black', 'blue', 'cyan', 'green', 'magenta', 'red', 'yellow'];
|
||||
var stylesAll = stylesColors.concat(['bold', 'italic', 'underline', 'inverse', 'rainbow']);
|
||||
|
||||
colors.mode = 'console';
|
||||
assert.equal(s.bold, '\x1B[1m' + s + '\x1B[22m');
|
||||
assert.equal(s.italic, '\x1B[3m' + s + '\x1B[23m');
|
||||
assert.equal(s.underline, '\x1B[4m' + s + '\x1B[24m');
|
||||
assert.equal(s.strikethrough, '\x1B[9m' + s + '\x1B[29m');
|
||||
assert.equal(s.inverse, '\x1B[7m' + s + '\x1B[27m');
|
||||
assert.ok(s.rainbow);
|
||||
aE(s, 'white', 37);
|
||||
aE(s, 'grey', 90);
|
||||
aE(s, 'black', 30);
|
||||
aE(s, 'blue', 34);
|
||||
aE(s, 'cyan', 36);
|
||||
aE(s, 'green', 32);
|
||||
aE(s, 'magenta', 35);
|
||||
aE(s, 'red', 31);
|
||||
aE(s, 'yellow', 33);
|
||||
assert.equal(s, 'string');
|
||||
|
||||
colors.setTheme({error:'red'});
|
||||
|
||||
assert.equal(typeof("astring".red),'string');
|
||||
assert.equal(typeof("astring".error),'string');
|
||||
|
||||
colors.mode = "browser";
|
||||
assert.equal(s.bold, '<b>' + s + '</b>');
|
||||
assert.equal(s.italic, '<i>' + s + '</i>');
|
||||
assert.equal(s.underline, '<u>' + s + '</u>');
|
||||
assert.equal(s.strikethrough, '<del>' + s + '</del>');
|
||||
assert.equal(s.inverse, '<span style="background-color:black;color:white;">' + s + '</span>');
|
||||
assert.ok(s.rainbow);
|
||||
stylesColors.forEach(function (color) {
|
||||
assert.equal(s[color], h(s, color));
|
||||
assert.equal(colors[color](s), h(s, color));
|
||||
});
|
||||
|
||||
assert.equal(typeof("astring".red),'string');
|
||||
assert.equal(typeof("astring".error),'string');
|
||||
|
||||
colors.mode = 'none';
|
||||
stylesAll.forEach(function (style) {
|
||||
assert.equal(s[style], s);
|
||||
assert.equal(colors[style](s), s);
|
||||
});
|
||||
|
||||
assert.equal(typeof("astring".red),'string');
|
||||
assert.equal(typeof("astring".error),'string');
|
||||
|
||||
assert.ok(typeof "hello".red !== 'undefined');
|
||||
colors.uninstall();
|
||||
assert.ok(typeof "hello".red === 'undefined');
|
||||
colors.install();
|
||||
assert.ok(typeof "hello".red !== 'undefined');
|
||||
|
||||
console.log("OK");
|
Reference in New Issue
Block a user