Initial commit, 90% there

This commit is contained in:
mdares
2025-12-02 16:27:21 +00:00
commit 755028af7e
7353 changed files with 1759505 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
language: node_js
node_js:
- 4
- 6
- 8
- 10
- 11

21
.node-red/node_modules/ansi-escape-sequences/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014-19 Lloyd Brookes <75pound@gmail.com>
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.

View File

@@ -0,0 +1,47 @@
[![view on npm](http://img.shields.io/npm/v/ansi-escape-sequences.svg)](https://www.npmjs.org/package/ansi-escape-sequences)
[![npm module downloads](http://img.shields.io/npm/dt/ansi-escape-sequences.svg)](https://www.npmjs.org/package/ansi-escape-sequences)
[![Build Status](https://travis-ci.org/75lb/ansi-escape-sequences.svg?branch=master)](https://travis-ci.org/75lb/ansi-escape-sequences)
[![Dependency Status](https://david-dm.org/75lb/ansi-escape-sequences.svg)](https://david-dm.org/75lb/ansi-escape-sequences)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)
# ansi-escape-sequences
A simple library containing all known terminal [ansi escape codes and sequences](http://en.wikipedia.org/wiki/ANSI_escape_code). Useful for adding colour to your command-line output, or building a dynamic text user interface.
## API Reference
{{#module name="ansi-escape-sequences"}}
{{>body~}}
{{>member-index~}}
{{>members~}}
{{/module}}
## Load anywhere
This library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation.
Node.js:
```js
const ansi = require('ansi-escape-sequences')
```
Within Node.js with ECMAScript Module support enabled:
```js
import ansi from 'ansi-escape-sequences'
```
Within a modern browser ECMAScript Module:
```js
import ansi from './node_modules/ansi-escape-sequences/dist/index.mjs'
```
Old browser (adds `window.ansi`):
```html
<script nomodule src="./node_modules/ansi-escape-sequences/dist/index.js"></script>
```
* * *
&copy; 2014-19 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).

310
.node-red/node_modules/ansi-escape-sequences/README.md generated vendored Normal file
View File

@@ -0,0 +1,310 @@
[![view on npm](http://img.shields.io/npm/v/ansi-escape-sequences.svg)](https://www.npmjs.org/package/ansi-escape-sequences)
[![npm module downloads](http://img.shields.io/npm/dt/ansi-escape-sequences.svg)](https://www.npmjs.org/package/ansi-escape-sequences)
[![Build Status](https://travis-ci.org/75lb/ansi-escape-sequences.svg?branch=master)](https://travis-ci.org/75lb/ansi-escape-sequences)
[![Dependency Status](https://david-dm.org/75lb/ansi-escape-sequences.svg)](https://david-dm.org/75lb/ansi-escape-sequences)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)
# ansi-escape-sequences
A simple library containing all known terminal [ansi escape codes and sequences](http://en.wikipedia.org/wiki/ANSI_escape_code). Useful for adding colour to your command-line output, or building a dynamic text user interface.
## API Reference
**Example**
```js
const ansi = require('ansi-escape-sequences')
```
* [ansi-escape-sequences](#module_ansi-escape-sequences)
* [.cursor](#module_ansi-escape-sequences.cursor)
* [.hide](#module_ansi-escape-sequences.cursor.hide)
* [.show](#module_ansi-escape-sequences.cursor.show)
* [.up([lines])](#module_ansi-escape-sequences.cursor.up) ⇒ <code>string</code>
* [.down([lines])](#module_ansi-escape-sequences.cursor.down) ⇒ <code>string</code>
* [.forward([lines])](#module_ansi-escape-sequences.cursor.forward) ⇒ <code>string</code>
* [.back([lines])](#module_ansi-escape-sequences.cursor.back) ⇒ <code>string</code>
* [.nextLine([lines])](#module_ansi-escape-sequences.cursor.nextLine) ⇒ <code>string</code>
* [.previousLine([lines])](#module_ansi-escape-sequences.cursor.previousLine) ⇒ <code>string</code>
* [.horizontalAbsolute(n)](#module_ansi-escape-sequences.cursor.horizontalAbsolute) ⇒ <code>string</code>
* [.position(n, m)](#module_ansi-escape-sequences.cursor.position) ⇒ <code>string</code>
* [.erase](#module_ansi-escape-sequences.erase)
* [.display(n)](#module_ansi-escape-sequences.erase.display) ⇒ <code>string</code>
* [.inLine(n)](#module_ansi-escape-sequences.erase.inLine) ⇒ <code>string</code>
* [.style](#module_ansi-escape-sequences.style) : <code>enum</code>
* [.styles(effectArray)](#module_ansi-escape-sequences.styles) ⇒ <code>string</code>
* [.format(str, [styleArray])](#module_ansi-escape-sequences.format) ⇒ <code>string</code>
<a name="module_ansi-escape-sequences.cursor"></a>
## ansi.cursor
cursor-related sequences
**Kind**: static property of [<code>ansi-escape-sequences</code>](#module_ansi-escape-sequences)
* [.cursor](#module_ansi-escape-sequences.cursor)
* [.hide](#module_ansi-escape-sequences.cursor.hide)
* [.show](#module_ansi-escape-sequences.cursor.show)
* [.up([lines])](#module_ansi-escape-sequences.cursor.up) ⇒ <code>string</code>
* [.down([lines])](#module_ansi-escape-sequences.cursor.down) ⇒ <code>string</code>
* [.forward([lines])](#module_ansi-escape-sequences.cursor.forward) ⇒ <code>string</code>
* [.back([lines])](#module_ansi-escape-sequences.cursor.back) ⇒ <code>string</code>
* [.nextLine([lines])](#module_ansi-escape-sequences.cursor.nextLine) ⇒ <code>string</code>
* [.previousLine([lines])](#module_ansi-escape-sequences.cursor.previousLine) ⇒ <code>string</code>
* [.horizontalAbsolute(n)](#module_ansi-escape-sequences.cursor.horizontalAbsolute) ⇒ <code>string</code>
* [.position(n, m)](#module_ansi-escape-sequences.cursor.position) ⇒ <code>string</code>
<a name="module_ansi-escape-sequences.cursor.hide"></a>
### cursor.hide
Hides the cursor
**Kind**: static property of [<code>cursor</code>](#module_ansi-escape-sequences.cursor)
<a name="module_ansi-escape-sequences.cursor.show"></a>
### cursor.show
Shows the cursor
**Kind**: static property of [<code>cursor</code>](#module_ansi-escape-sequences.cursor)
<a name="module_ansi-escape-sequences.cursor.up"></a>
### cursor.up([lines]) ⇒ <code>string</code>
Moves the cursor `lines` cells up. If the cursor is already at the edge of the screen, this has no effect
**Kind**: static method of [<code>cursor</code>](#module_ansi-escape-sequences.cursor)
| Param | Type | Default |
| --- | --- | --- |
| [lines] | <code>number</code> | <code>1</code> |
<a name="module_ansi-escape-sequences.cursor.down"></a>
### cursor.down([lines]) ⇒ <code>string</code>
Moves the cursor `lines` cells down. If the cursor is already at the edge of the screen, this has no effect
**Kind**: static method of [<code>cursor</code>](#module_ansi-escape-sequences.cursor)
| Param | Type | Default |
| --- | --- | --- |
| [lines] | <code>number</code> | <code>1</code> |
<a name="module_ansi-escape-sequences.cursor.forward"></a>
### cursor.forward([lines]) ⇒ <code>string</code>
Moves the cursor `lines` cells forward. If the cursor is already at the edge of the screen, this has no effect
**Kind**: static method of [<code>cursor</code>](#module_ansi-escape-sequences.cursor)
| Param | Type | Default |
| --- | --- | --- |
| [lines] | <code>number</code> | <code>1</code> |
<a name="module_ansi-escape-sequences.cursor.back"></a>
### cursor.back([lines]) ⇒ <code>string</code>
Moves the cursor `lines` cells back. If the cursor is already at the edge of the screen, this has no effect
**Kind**: static method of [<code>cursor</code>](#module_ansi-escape-sequences.cursor)
| Param | Type | Default |
| --- | --- | --- |
| [lines] | <code>number</code> | <code>1</code> |
<a name="module_ansi-escape-sequences.cursor.nextLine"></a>
### cursor.nextLine([lines]) ⇒ <code>string</code>
Moves cursor to beginning of the line n lines down.
**Kind**: static method of [<code>cursor</code>](#module_ansi-escape-sequences.cursor)
| Param | Type | Default |
| --- | --- | --- |
| [lines] | <code>number</code> | <code>1</code> |
<a name="module_ansi-escape-sequences.cursor.previousLine"></a>
### cursor.previousLine([lines]) ⇒ <code>string</code>
Moves cursor to beginning of the line n lines up.
**Kind**: static method of [<code>cursor</code>](#module_ansi-escape-sequences.cursor)
| Param | Type | Default |
| --- | --- | --- |
| [lines] | <code>number</code> | <code>1</code> |
<a name="module_ansi-escape-sequences.cursor.horizontalAbsolute"></a>
### cursor.horizontalAbsolute(n) ⇒ <code>string</code>
Moves the cursor to column n.
**Kind**: static method of [<code>cursor</code>](#module_ansi-escape-sequences.cursor)
| Param | Type | Description |
| --- | --- | --- |
| n | <code>number</code> | column number |
<a name="module_ansi-escape-sequences.cursor.position"></a>
### cursor.position(n, m) ⇒ <code>string</code>
Moves the cursor to row n, column m. The values are 1-based, and default to 1 (top left corner) if omitted.
**Kind**: static method of [<code>cursor</code>](#module_ansi-escape-sequences.cursor)
| Param | Type | Description |
| --- | --- | --- |
| n | <code>number</code> | row number |
| m | <code>number</code> | column number |
<a name="module_ansi-escape-sequences.erase"></a>
## ansi.erase
erase sequences
**Kind**: static property of [<code>ansi-escape-sequences</code>](#module_ansi-escape-sequences)
* [.erase](#module_ansi-escape-sequences.erase)
* [.display(n)](#module_ansi-escape-sequences.erase.display) ⇒ <code>string</code>
* [.inLine(n)](#module_ansi-escape-sequences.erase.inLine) ⇒ <code>string</code>
<a name="module_ansi-escape-sequences.erase.display"></a>
### erase.display(n) ⇒ <code>string</code>
Clears part of the screen. If n is 0 (or missing), clear from cursor to end of screen. If n is 1, clear from cursor to beginning of the screen. If n is 2, clear entire screen.
**Kind**: static method of [<code>erase</code>](#module_ansi-escape-sequences.erase)
| Param | Type |
| --- | --- |
| n | <code>number</code> |
<a name="module_ansi-escape-sequences.erase.inLine"></a>
### erase.inLine(n) ⇒ <code>string</code>
Erases part of the line. If n is zero (or missing), clear from cursor to the end of the line. If n is one, clear from cursor to beginning of the line. If n is two, clear entire line. Cursor position does not change.
**Kind**: static method of [<code>erase</code>](#module_ansi-escape-sequences.erase)
| Param | Type |
| --- | --- |
| n | <code>number</code> |
<a name="module_ansi-escape-sequences.style"></a>
## ansi.style : <code>enum</code>
Various formatting styles (aka Select Graphic Rendition codes).
**Kind**: static enum of [<code>ansi-escape-sequences</code>](#module_ansi-escape-sequences)
**Properties**
| Name | Type | Default |
| --- | --- | --- |
| reset | <code>string</code> | <code>&quot;\u001b[0m&quot;</code> |
| bold | <code>string</code> | <code>&quot;\u001b[1m&quot;</code> |
| italic | <code>string</code> | <code>&quot;\u001b[3m&quot;</code> |
| underline | <code>string</code> | <code>&quot;\u001b[4m&quot;</code> |
| fontDefault | <code>string</code> | <code>&quot;\u001b[10m&quot;</code> |
| font2 | <code>string</code> | <code>&quot;\u001b[11m&quot;</code> |
| font3 | <code>string</code> | <code>&quot;\u001b[12m&quot;</code> |
| font4 | <code>string</code> | <code>&quot;\u001b[13m&quot;</code> |
| font5 | <code>string</code> | <code>&quot;\u001b[14m&quot;</code> |
| font6 | <code>string</code> | <code>&quot;\u001b[15m&quot;</code> |
| imageNegative | <code>string</code> | <code>&quot;\u001b[7m&quot;</code> |
| imagePositive | <code>string</code> | <code>&quot;\u001b[27m&quot;</code> |
| black | <code>string</code> | <code>&quot;\u001b[30m&quot;</code> |
| red | <code>string</code> | <code>&quot;\u001b[31m&quot;</code> |
| green | <code>string</code> | <code>&quot;\u001b[32m&quot;</code> |
| yellow | <code>string</code> | <code>&quot;\u001b[33m&quot;</code> |
| blue | <code>string</code> | <code>&quot;\u001b[34m&quot;</code> |
| magenta | <code>string</code> | <code>&quot;\u001b[35m&quot;</code> |
| cyan | <code>string</code> | <code>&quot;\u001b[36m&quot;</code> |
| white | <code>string</code> | <code>&quot;\u001b[37m&quot;</code> |
| grey | <code>string</code> | <code>&quot;\u001b[90m&quot;</code> |
| gray | <code>string</code> | <code>&quot;\u001b[90m&quot;</code> |
| "bg-black" | <code>string</code> | <code>&quot;\u001b[40m&quot;</code> |
| "bg-red" | <code>string</code> | <code>&quot;\u001b[41m&quot;</code> |
| "bg-green" | <code>string</code> | <code>&quot;\u001b[42m&quot;</code> |
| "bg-yellow" | <code>string</code> | <code>&quot;\u001b[43m&quot;</code> |
| "bg-blue" | <code>string</code> | <code>&quot;\u001b[44m&quot;</code> |
| "bg-magenta" | <code>string</code> | <code>&quot;\u001b[45m&quot;</code> |
| "bg-cyan" | <code>string</code> | <code>&quot;\u001b[46m&quot;</code> |
| "bg-white" | <code>string</code> | <code>&quot;\u001b[47m&quot;</code> |
| "bg-grey" | <code>string</code> | <code>&quot;\u001b[100m&quot;</code> |
| "bg-gray" | <code>string</code> | <code>&quot;\u001b[100m&quot;</code> |
**Example**
```js
console.log(ansi.style.red + 'this is red' + ansi.style.reset)
```
<a name="module_ansi-escape-sequences.styles"></a>
## ansi.styles(effectArray) ⇒ <code>string</code>
Returns an ansi sequence setting one or more effects
**Kind**: static method of [<code>ansi-escape-sequences</code>](#module_ansi-escape-sequences)
| Param | Type | Description |
| --- | --- | --- |
| effectArray | <code>string</code> \| <code>Array.&lt;string&gt;</code> | a style, or list or styles |
**Example**
```js
> ansi.styles('green')
'\u001b[32m'
> ansi.styles([ 'green', 'underline' ])
'\u001b[32;4m'
```
<a name="module_ansi-escape-sequences.format"></a>
## ansi.format(str, [styleArray]) ⇒ <code>string</code>
A convenience function, applying the provided styles to the input string and then resetting.
Inline styling can be applied using the syntax `[style-list]{text to format}`, where `style-list` is a space-separated list of styles from [ansi.style](#module_ansi-escape-sequences.style). For example `[bold white bg-red]{bold white text on a red background}`.
**Kind**: static method of [<code>ansi-escape-sequences</code>](#module_ansi-escape-sequences)
| Param | Type | Description |
| --- | --- | --- |
| str | <code>string</code> | the string to format |
| [styleArray] | <code>Array.&lt;string&gt;</code> | a list of styles to add to the input string |
**Example**
```js
> ansi.format('what?', 'green')
'\u001b[32mwhat?\u001b[0m'
> ansi.format('what?', ['green', 'bold'])
'\u001b[32;1mwhat?\u001b[0m'
> ansi.format('[green bold]{what?}')
'\u001b[32;1mwhat?\u001b[0m'
```
## Load anywhere
This library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation.
Node.js:
```js
const ansi = require('ansi-escape-sequences')
```
Within Node.js with ECMAScript Module support enabled:
```js
import ansi from 'ansi-escape-sequences'
```
Within a modern browser ECMAScript Module:
```js
import ansi from './node_modules/ansi-escape-sequences/dist/index.mjs'
```
Old browser (adds `window.ansi`):
```html
<script nomodule src="./node_modules/ansi-escape-sequences/dist/index.js"></script>
```
* * *
&copy; 2014-19 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).

View File

@@ -0,0 +1,298 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = global || self, global.ansi = factory());
}(this, function () { 'use strict';
/**
* Takes any input and guarantees an array back.
*
* - converts array-like objects (e.g. `arguments`) to a real array
* - converts `undefined` to an empty array
* - converts any another other, singular value (including `null`) into an array containing that value
* - ignores input which is already an array
*
* @module array-back
* @example
* > const arrayify = require('array-back')
*
* > arrayify(undefined)
* []
*
* > arrayify(null)
* [ null ]
*
* > arrayify(0)
* [ 0 ]
*
* > arrayify([ 1, 2 ])
* [ 1, 2 ]
*
* > function f(){ return arrayify(arguments); }
* > f(1,2,3)
* [ 1, 2, 3 ]
*/
function isObject (input) {
return typeof input === 'object' && input !== null
}
function isArrayLike (input) {
return isObject(input) && typeof input.length === 'number'
}
/**
* @param {*} - the input value to convert to an array
* @returns {Array}
* @alias module:array-back
*/
function arrayify (input) {
if (Array.isArray(input)) {
return input
} else {
if (input === undefined) {
return []
} else if (isArrayLike(input)) {
return Array.prototype.slice.call(input)
} else {
return [ input ]
}
}
}
/* Control Sequence Initiator */
const csi = '\x1b[';
/**
* @exports ansi-escape-sequences
* @typicalname ansi
* @example
* const ansi = require('ansi-escape-sequences')
*/
const ansi = {};
/**
* Various formatting styles (aka Select Graphic Rendition codes).
* @enum {string}
* @example
* console.log(ansi.style.red + 'this is red' + ansi.style.reset)
*/
ansi.style = {
reset: '\x1b[0m',
bold: '\x1b[1m',
italic: '\x1b[3m',
underline: '\x1b[4m',
fontDefault: '\x1b[10m',
font2: '\x1b[11m',
font3: '\x1b[12m',
font4: '\x1b[13m',
font5: '\x1b[14m',
font6: '\x1b[15m',
imageNegative: '\x1b[7m',
imagePositive: '\x1b[27m',
black: '\x1b[30m',
red: '\x1b[31m',
green: '\x1b[32m',
yellow: '\x1b[33m',
blue: '\x1b[34m',
magenta: '\x1b[35m',
cyan: '\x1b[36m',
white: '\x1b[37m',
grey: '\x1b[90m',
gray: '\x1b[90m',
'bg-black': '\x1b[40m',
'bg-red': '\x1b[41m',
'bg-green': '\x1b[42m',
'bg-yellow': '\x1b[43m',
'bg-blue': '\x1b[44m',
'bg-magenta': '\x1b[45m',
'bg-cyan': '\x1b[46m',
'bg-white': '\x1b[47m',
'bg-grey': '\x1b[100m',
'bg-gray': '\x1b[100m'
};
/**
* style enum - used by `ansi.styles()`.
* @enum {number}
* @private
*/
const eStyles = {
reset: 0,
bold: 1,
italic: 3,
underline: 4,
imageNegative: 7,
fontDefault: 10,
font2: 11,
font3: 12,
font4: 13,
font5: 14,
font6: 15,
imagePositive: 27,
black: 30,
red: 31,
green: 32,
yellow: 33,
blue: 34,
magenta: 35,
cyan: 36,
white: 37,
grey: 90,
gray: 90,
'bg-black': 40,
'bg-red': 41,
'bg-green': 42,
'bg-yellow': 43,
'bg-blue': 44,
'bg-magenta': 45,
'bg-cyan': 46,
'bg-white': 47,
'bg-grey': 100,
'bg-gray': 100
};
/**
* Returns an ansi sequence setting one or more effects
* @param {string | string[]} - a style, or list or styles
* @returns {string}
* @example
* > ansi.styles('green')
* '\u001b[32m'
*
* > ansi.styles([ 'green', 'underline' ])
* '\u001b[32;4m'
*/
ansi.styles = function (effectArray) {
effectArray = arrayify(effectArray);
return csi + effectArray.map(function (effect) { return eStyles[effect] }).join(';') + 'm'
};
/**
* A convenience function, applying the provided styles to the input string and then resetting.
*
* Inline styling can be applied using the syntax `[style-list]{text to format}`, where `style-list` is a space-separated list of styles from {@link module:ansi-escape-sequences.style ansi.style}. For example `[bold white bg-red]{bold white text on a red background}`.
*
* @param {string} - the string to format
* @param [styleArray] {string[]} - a list of styles to add to the input string
* @returns {string}
* @example
* > ansi.format('what?', 'green')
* '\u001b[32mwhat?\u001b[0m'
*
* > ansi.format('what?', ['green', 'bold'])
* '\u001b[32;1mwhat?\u001b[0m'
*
* > ansi.format('[green bold]{what?}')
* '\u001b[32;1mwhat?\u001b[0m'
*/
ansi.format = function (str, styleArray) {
const re = /\[([\w\s-]+)\]{([^]*?)}/;
let matches;
if (!str) return ''
while (matches = str.match(re)) {
const inlineStyles = matches[1].split(/\s+/);
const inlineString = matches[2];
str = str.replace(matches[0], ansi.format(inlineString, inlineStyles));
}
return (styleArray && styleArray.length)
? ansi.styles(styleArray) + str + ansi.style.reset
: str
};
/**
* cursor-related sequences
*/
ansi.cursor = {
/**
* Moves the cursor `lines` cells up. If the cursor is already at the edge of the screen, this has no effect
* @param [lines=1] {number}
* @return {string}
*/
up: function (lines) { return csi + (lines || 1) + 'A' },
/**
* Moves the cursor `lines` cells down. If the cursor is already at the edge of the screen, this has no effect
* @param [lines=1] {number}
* @return {string}
*/
down: function (lines) { return csi + (lines || 1) + 'B' },
/**
* Moves the cursor `lines` cells forward. If the cursor is already at the edge of the screen, this has no effect
* @param [lines=1] {number}
* @return {string}
*/
forward: function (lines) { return csi + (lines || 1) + 'C' },
/**
* Moves the cursor `lines` cells back. If the cursor is already at the edge of the screen, this has no effect
* @param [lines=1] {number}
* @return {string}
*/
back: function (lines) { return csi + (lines || 1) + 'D' },
/**
* Moves cursor to beginning of the line n lines down.
* @param [lines=1] {number}
* @return {string}
*/
nextLine: function (lines) { return csi + (lines || 1) + 'E' },
/**
* Moves cursor to beginning of the line n lines up.
* @param [lines=1] {number}
* @return {string}
*/
previousLine: function (lines) { return csi + (lines || 1) + 'F' },
/**
* Moves the cursor to column n.
* @param n {number} - column number
* @return {string}
*/
horizontalAbsolute: function (n) { return csi + n + 'G' },
/**
* Moves the cursor to row n, column m. The values are 1-based, and default to 1 (top left corner) if omitted.
* @param n {number} - row number
* @param m {number} - column number
* @return {string}
*/
position: function (n, m) { return csi + (n || 1) + ';' + (m || 1) + 'H' },
/**
* Hides the cursor
*/
hide: csi + '?25l',
/**
* Shows the cursor
*/
show: csi + '?25h'
};
/**
* erase sequences
*/
ansi.erase = {
/**
* Clears part of the screen. If n is 0 (or missing), clear from cursor to end of screen. If n is 1, clear from cursor to beginning of the screen. If n is 2, clear entire screen.
* @param n {number}
* @return {string}
*/
display: function (n) { return csi + (n || 0) + 'J' },
/**
* Erases part of the line. If n is zero (or missing), clear from cursor to the end of the line. If n is one, clear from cursor to beginning of the line. If n is two, clear entire line. Cursor position does not change.
* @param n {number}
* @return {string}
*/
inLine: function (n) { return csi + (n || 0) + 'K' }
};
return ansi;
}));

View File

@@ -0,0 +1,290 @@
/**
* Takes any input and guarantees an array back.
*
* - converts array-like objects (e.g. `arguments`) to a real array
* - converts `undefined` to an empty array
* - converts any another other, singular value (including `null`) into an array containing that value
* - ignores input which is already an array
*
* @module array-back
* @example
* > const arrayify = require('array-back')
*
* > arrayify(undefined)
* []
*
* > arrayify(null)
* [ null ]
*
* > arrayify(0)
* [ 0 ]
*
* > arrayify([ 1, 2 ])
* [ 1, 2 ]
*
* > function f(){ return arrayify(arguments); }
* > f(1,2,3)
* [ 1, 2, 3 ]
*/
function isObject (input) {
return typeof input === 'object' && input !== null
}
function isArrayLike (input) {
return isObject(input) && typeof input.length === 'number'
}
/**
* @param {*} - the input value to convert to an array
* @returns {Array}
* @alias module:array-back
*/
function arrayify (input) {
if (Array.isArray(input)) {
return input
} else {
if (input === undefined) {
return []
} else if (isArrayLike(input)) {
return Array.prototype.slice.call(input)
} else {
return [ input ]
}
}
}
/* Control Sequence Initiator */
const csi = '\x1b[';
/**
* @exports ansi-escape-sequences
* @typicalname ansi
* @example
* const ansi = require('ansi-escape-sequences')
*/
const ansi = {};
/**
* Various formatting styles (aka Select Graphic Rendition codes).
* @enum {string}
* @example
* console.log(ansi.style.red + 'this is red' + ansi.style.reset)
*/
ansi.style = {
reset: '\x1b[0m',
bold: '\x1b[1m',
italic: '\x1b[3m',
underline: '\x1b[4m',
fontDefault: '\x1b[10m',
font2: '\x1b[11m',
font3: '\x1b[12m',
font4: '\x1b[13m',
font5: '\x1b[14m',
font6: '\x1b[15m',
imageNegative: '\x1b[7m',
imagePositive: '\x1b[27m',
black: '\x1b[30m',
red: '\x1b[31m',
green: '\x1b[32m',
yellow: '\x1b[33m',
blue: '\x1b[34m',
magenta: '\x1b[35m',
cyan: '\x1b[36m',
white: '\x1b[37m',
grey: '\x1b[90m',
gray: '\x1b[90m',
'bg-black': '\x1b[40m',
'bg-red': '\x1b[41m',
'bg-green': '\x1b[42m',
'bg-yellow': '\x1b[43m',
'bg-blue': '\x1b[44m',
'bg-magenta': '\x1b[45m',
'bg-cyan': '\x1b[46m',
'bg-white': '\x1b[47m',
'bg-grey': '\x1b[100m',
'bg-gray': '\x1b[100m'
};
/**
* style enum - used by `ansi.styles()`.
* @enum {number}
* @private
*/
const eStyles = {
reset: 0,
bold: 1,
italic: 3,
underline: 4,
imageNegative: 7,
fontDefault: 10,
font2: 11,
font3: 12,
font4: 13,
font5: 14,
font6: 15,
imagePositive: 27,
black: 30,
red: 31,
green: 32,
yellow: 33,
blue: 34,
magenta: 35,
cyan: 36,
white: 37,
grey: 90,
gray: 90,
'bg-black': 40,
'bg-red': 41,
'bg-green': 42,
'bg-yellow': 43,
'bg-blue': 44,
'bg-magenta': 45,
'bg-cyan': 46,
'bg-white': 47,
'bg-grey': 100,
'bg-gray': 100
};
/**
* Returns an ansi sequence setting one or more effects
* @param {string | string[]} - a style, or list or styles
* @returns {string}
* @example
* > ansi.styles('green')
* '\u001b[32m'
*
* > ansi.styles([ 'green', 'underline' ])
* '\u001b[32;4m'
*/
ansi.styles = function (effectArray) {
effectArray = arrayify(effectArray);
return csi + effectArray.map(function (effect) { return eStyles[effect] }).join(';') + 'm'
};
/**
* A convenience function, applying the provided styles to the input string and then resetting.
*
* Inline styling can be applied using the syntax `[style-list]{text to format}`, where `style-list` is a space-separated list of styles from {@link module:ansi-escape-sequences.style ansi.style}. For example `[bold white bg-red]{bold white text on a red background}`.
*
* @param {string} - the string to format
* @param [styleArray] {string[]} - a list of styles to add to the input string
* @returns {string}
* @example
* > ansi.format('what?', 'green')
* '\u001b[32mwhat?\u001b[0m'
*
* > ansi.format('what?', ['green', 'bold'])
* '\u001b[32;1mwhat?\u001b[0m'
*
* > ansi.format('[green bold]{what?}')
* '\u001b[32;1mwhat?\u001b[0m'
*/
ansi.format = function (str, styleArray) {
const re = /\[([\w\s-]+)\]{([^]*?)}/;
let matches;
if (!str) return ''
while (matches = str.match(re)) {
const inlineStyles = matches[1].split(/\s+/);
const inlineString = matches[2];
str = str.replace(matches[0], ansi.format(inlineString, inlineStyles));
}
return (styleArray && styleArray.length)
? ansi.styles(styleArray) + str + ansi.style.reset
: str
};
/**
* cursor-related sequences
*/
ansi.cursor = {
/**
* Moves the cursor `lines` cells up. If the cursor is already at the edge of the screen, this has no effect
* @param [lines=1] {number}
* @return {string}
*/
up: function (lines) { return csi + (lines || 1) + 'A' },
/**
* Moves the cursor `lines` cells down. If the cursor is already at the edge of the screen, this has no effect
* @param [lines=1] {number}
* @return {string}
*/
down: function (lines) { return csi + (lines || 1) + 'B' },
/**
* Moves the cursor `lines` cells forward. If the cursor is already at the edge of the screen, this has no effect
* @param [lines=1] {number}
* @return {string}
*/
forward: function (lines) { return csi + (lines || 1) + 'C' },
/**
* Moves the cursor `lines` cells back. If the cursor is already at the edge of the screen, this has no effect
* @param [lines=1] {number}
* @return {string}
*/
back: function (lines) { return csi + (lines || 1) + 'D' },
/**
* Moves cursor to beginning of the line n lines down.
* @param [lines=1] {number}
* @return {string}
*/
nextLine: function (lines) { return csi + (lines || 1) + 'E' },
/**
* Moves cursor to beginning of the line n lines up.
* @param [lines=1] {number}
* @return {string}
*/
previousLine: function (lines) { return csi + (lines || 1) + 'F' },
/**
* Moves the cursor to column n.
* @param n {number} - column number
* @return {string}
*/
horizontalAbsolute: function (n) { return csi + n + 'G' },
/**
* Moves the cursor to row n, column m. The values are 1-based, and default to 1 (top left corner) if omitted.
* @param n {number} - row number
* @param m {number} - column number
* @return {string}
*/
position: function (n, m) { return csi + (n || 1) + ';' + (m || 1) + 'H' },
/**
* Hides the cursor
*/
hide: csi + '?25l',
/**
* Shows the cursor
*/
show: csi + '?25h'
};
/**
* erase sequences
*/
ansi.erase = {
/**
* Clears part of the screen. If n is 0 (or missing), clear from cursor to end of screen. If n is 1, clear from cursor to beginning of the screen. If n is 2, clear entire screen.
* @param n {number}
* @return {string}
*/
display: function (n) { return csi + (n || 0) + 'J' },
/**
* Erases part of the line. If n is zero (or missing), clear from cursor to the end of the line. If n is one, clear from cursor to beginning of the line. If n is two, clear entire line. Cursor position does not change.
* @param n {number}
* @return {string}
*/
inLine: function (n) { return csi + (n || 0) + 'K' }
};
export default ansi;

236
.node-red/node_modules/ansi-escape-sequences/index.mjs generated vendored Normal file
View File

@@ -0,0 +1,236 @@
import arrayify from './node_modules/array-back/index.mjs'
/* Control Sequence Initiator */
const csi = '\x1b['
/**
* @exports ansi-escape-sequences
* @typicalname ansi
* @example
* const ansi = require('ansi-escape-sequences')
*/
const ansi = {}
/**
* Various formatting styles (aka Select Graphic Rendition codes).
* @enum {string}
* @example
* console.log(ansi.style.red + 'this is red' + ansi.style.reset)
*/
ansi.style = {
reset: '\x1b[0m',
bold: '\x1b[1m',
italic: '\x1b[3m',
underline: '\x1b[4m',
fontDefault: '\x1b[10m',
font2: '\x1b[11m',
font3: '\x1b[12m',
font4: '\x1b[13m',
font5: '\x1b[14m',
font6: '\x1b[15m',
imageNegative: '\x1b[7m',
imagePositive: '\x1b[27m',
black: '\x1b[30m',
red: '\x1b[31m',
green: '\x1b[32m',
yellow: '\x1b[33m',
blue: '\x1b[34m',
magenta: '\x1b[35m',
cyan: '\x1b[36m',
white: '\x1b[37m',
grey: '\x1b[90m',
gray: '\x1b[90m',
'bg-black': '\x1b[40m',
'bg-red': '\x1b[41m',
'bg-green': '\x1b[42m',
'bg-yellow': '\x1b[43m',
'bg-blue': '\x1b[44m',
'bg-magenta': '\x1b[45m',
'bg-cyan': '\x1b[46m',
'bg-white': '\x1b[47m',
'bg-grey': '\x1b[100m',
'bg-gray': '\x1b[100m'
}
/**
* style enum - used by `ansi.styles()`.
* @enum {number}
* @private
*/
const eStyles = {
reset: 0,
bold: 1,
italic: 3,
underline: 4,
imageNegative: 7,
fontDefault: 10,
font2: 11,
font3: 12,
font4: 13,
font5: 14,
font6: 15,
imagePositive: 27,
black: 30,
red: 31,
green: 32,
yellow: 33,
blue: 34,
magenta: 35,
cyan: 36,
white: 37,
grey: 90,
gray: 90,
'bg-black': 40,
'bg-red': 41,
'bg-green': 42,
'bg-yellow': 43,
'bg-blue': 44,
'bg-magenta': 45,
'bg-cyan': 46,
'bg-white': 47,
'bg-grey': 100,
'bg-gray': 100
}
/**
* Returns an ansi sequence setting one or more effects
* @param {string | string[]} - a style, or list or styles
* @returns {string}
* @example
* > ansi.styles('green')
* '\u001b[32m'
*
* > ansi.styles([ 'green', 'underline' ])
* '\u001b[32;4m'
*/
ansi.styles = function (effectArray) {
effectArray = arrayify(effectArray)
return csi + effectArray.map(function (effect) { return eStyles[effect] }).join(';') + 'm'
}
/**
* A convenience function, applying the provided styles to the input string and then resetting.
*
* Inline styling can be applied using the syntax `[style-list]{text to format}`, where `style-list` is a space-separated list of styles from {@link module:ansi-escape-sequences.style ansi.style}. For example `[bold white bg-red]{bold white text on a red background}`.
*
* @param {string} - the string to format
* @param [styleArray] {string[]} - a list of styles to add to the input string
* @returns {string}
* @example
* > ansi.format('what?', 'green')
* '\u001b[32mwhat?\u001b[0m'
*
* > ansi.format('what?', ['green', 'bold'])
* '\u001b[32;1mwhat?\u001b[0m'
*
* > ansi.format('[green bold]{what?}')
* '\u001b[32;1mwhat?\u001b[0m'
*/
ansi.format = function (str, styleArray) {
const re = /\[([\w\s-]+)\]{([^]*?)}/
let matches
if (!str) return ''
while (matches = str.match(re)) {
const inlineStyles = matches[1].split(/\s+/)
const inlineString = matches[2]
str = str.replace(matches[0], ansi.format(inlineString, inlineStyles))
}
return (styleArray && styleArray.length)
? ansi.styles(styleArray) + str + ansi.style.reset
: str
}
/**
* cursor-related sequences
*/
ansi.cursor = {
/**
* Moves the cursor `lines` cells up. If the cursor is already at the edge of the screen, this has no effect
* @param [lines=1] {number}
* @return {string}
*/
up: function (lines) { return csi + (lines || 1) + 'A' },
/**
* Moves the cursor `lines` cells down. If the cursor is already at the edge of the screen, this has no effect
* @param [lines=1] {number}
* @return {string}
*/
down: function (lines) { return csi + (lines || 1) + 'B' },
/**
* Moves the cursor `lines` cells forward. If the cursor is already at the edge of the screen, this has no effect
* @param [lines=1] {number}
* @return {string}
*/
forward: function (lines) { return csi + (lines || 1) + 'C' },
/**
* Moves the cursor `lines` cells back. If the cursor is already at the edge of the screen, this has no effect
* @param [lines=1] {number}
* @return {string}
*/
back: function (lines) { return csi + (lines || 1) + 'D' },
/**
* Moves cursor to beginning of the line n lines down.
* @param [lines=1] {number}
* @return {string}
*/
nextLine: function (lines) { return csi + (lines || 1) + 'E' },
/**
* Moves cursor to beginning of the line n lines up.
* @param [lines=1] {number}
* @return {string}
*/
previousLine: function (lines) { return csi + (lines || 1) + 'F' },
/**
* Moves the cursor to column n.
* @param n {number} - column number
* @return {string}
*/
horizontalAbsolute: function (n) { return csi + n + 'G' },
/**
* Moves the cursor to row n, column m. The values are 1-based, and default to 1 (top left corner) if omitted.
* @param n {number} - row number
* @param m {number} - column number
* @return {string}
*/
position: function (n, m) { return csi + (n || 1) + ';' + (m || 1) + 'H' },
/**
* Hides the cursor
*/
hide: csi + '?25l',
/**
* Shows the cursor
*/
show: csi + '?25h'
}
/**
* erase sequences
*/
ansi.erase = {
/**
* Clears part of the screen. If n is 0 (or missing), clear from cursor to end of screen. If n is 1, clear from cursor to beginning of the screen. If n is 2, clear entire screen.
* @param n {number}
* @return {string}
*/
display: function (n) { return csi + (n || 0) + 'J' },
/**
* Erases part of the line. If n is zero (or missing), clear from cursor to the end of the line. If n is one, clear from cursor to beginning of the line. If n is two, clear entire line. Cursor position does not change.
* @param n {number}
* @return {string}
*/
inLine: function (n) { return csi + (n || 0) + 'K' }
}
export default ansi

View File

@@ -0,0 +1,5 @@
{
"source": {
"includePattern": ".+\\.(js(doc|x)?|mjs)$"
}
}

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015-19 Lloyd Brookes <75pound@gmail.com>
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.

View File

@@ -0,0 +1,40 @@
[![view on npm](https://img.shields.io/npm/v/array-back.svg)](https://www.npmjs.org/package/array-back)
[![npm module downloads](https://img.shields.io/npm/dt/array-back.svg)](https://www.npmjs.org/package/array-back)
[![Build Status](https://travis-ci.org/75lb/array-back.svg?branch=master)](https://travis-ci.org/75lb/array-back)
[![Coverage Status](https://coveralls.io/repos/github/75lb/array-back/badge.svg?branch=master)](https://coveralls.io/github/75lb/array-back?branch=master)
[![Dependency Status](https://david-dm.org/75lb/array-back.svg)](https://david-dm.org/75lb/array-back)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)
{{>main}}
### Load anywhere
This library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation.
Node.js:
```js
const arrayify = require('array-back')
```
Within Node.js with ECMAScript Module support enabled:
```js
import arrayify from 'array-back'
```
Within an modern browser ECMAScript Module:
```js
import arrayify from './node_modules/array-back/index.mjs'
```
Old browser (adds `window.arrayBack`):
```html
<script nomodule src="./node_modules/array-back/dist/index.js"></script>
```
* * *
&copy; 2015-19 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown).

View File

@@ -0,0 +1,81 @@
[![view on npm](https://img.shields.io/npm/v/array-back.svg)](https://www.npmjs.org/package/array-back)
[![npm module downloads](https://img.shields.io/npm/dt/array-back.svg)](https://www.npmjs.org/package/array-back)
[![Build Status](https://travis-ci.org/75lb/array-back.svg?branch=master)](https://travis-ci.org/75lb/array-back)
[![Coverage Status](https://coveralls.io/repos/github/75lb/array-back/badge.svg?branch=master)](https://coveralls.io/github/75lb/array-back?branch=master)
[![Dependency Status](https://david-dm.org/75lb/array-back.svg)](https://david-dm.org/75lb/array-back)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)
<a name="module_array-back"></a>
## array-back
Takes any input and guarantees an array back.
- Converts array-like objects (e.g. `arguments`, `Set`) to a real array.
- Converts `undefined` to an empty array.
- Converts any another other, singular value (including `null`, objects and iterables other than `Set`) into an array containing that value.
- Ignores input which is already an array.
**Example**
```js
> const arrayify = require('array-back')
> arrayify(undefined)
[]
> arrayify(null)
[ null ]
> arrayify(0)
[ 0 ]
> arrayify([ 1, 2 ])
[ 1, 2 ]
> arrayify(new Set([ 1, 2 ]))
[ 1, 2 ]
> function f(){ return arrayify(arguments); }
> f(1,2,3)
[ 1, 2, 3 ]
```
<a name="exp_module_array-back--arrayify"></a>
### arrayify(input) ⇒ <code>Array</code> ⏏
**Kind**: Exported function
| Param | Type | Description |
| --- | --- | --- |
| input | <code>\*</code> | The input value to convert to an array |
### Load anywhere
This library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation.
Node.js:
```js
const arrayify = require('array-back')
```
Within Node.js with ECMAScript Module support enabled:
```js
import arrayify from 'array-back'
```
Within an modern browser ECMAScript Module:
```js
import arrayify from './node_modules/array-back/index.mjs'
```
Old browser (adds `window.arrayBack`):
```html
<script nomodule src="./node_modules/array-back/dist/index.js"></script>
```
* * *
&copy; 2015-19 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown).

View File

@@ -0,0 +1,70 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = global || self, global.arrayBack = factory());
}(this, function () { 'use strict';
/**
* Takes any input and guarantees an array back.
*
* - Converts array-like objects (e.g. `arguments`, `Set`) to a real array.
* - Converts `undefined` to an empty array.
* - Converts any another other, singular value (including `null`, objects and iterables other than `Set`) into an array containing that value.
* - Ignores input which is already an array.
*
* @module array-back
* @example
* > const arrayify = require('array-back')
*
* > arrayify(undefined)
* []
*
* > arrayify(null)
* [ null ]
*
* > arrayify(0)
* [ 0 ]
*
* > arrayify([ 1, 2 ])
* [ 1, 2 ]
*
* > arrayify(new Set([ 1, 2 ]))
* [ 1, 2 ]
*
* > function f(){ return arrayify(arguments); }
* > f(1,2,3)
* [ 1, 2, 3 ]
*/
function isObject (input) {
return typeof input === 'object' && input !== null
}
function isArrayLike (input) {
return isObject(input) && typeof input.length === 'number'
}
/**
* @param {*} - The input value to convert to an array
* @returns {Array}
* @alias module:array-back
*/
function arrayify (input) {
if (Array.isArray(input)) {
return input
}
if (input === undefined) {
return []
}
if (isArrayLike(input) || input instanceof Set) {
return Array.from(input)
}
return [ input ]
}
return arrayify;
}));

View File

@@ -0,0 +1,62 @@
/**
* Takes any input and guarantees an array back.
*
* - Converts array-like objects (e.g. `arguments`, `Set`) to a real array.
* - Converts `undefined` to an empty array.
* - Converts any another other, singular value (including `null`, objects and iterables other than `Set`) into an array containing that value.
* - Ignores input which is already an array.
*
* @module array-back
* @example
* > const arrayify = require('array-back')
*
* > arrayify(undefined)
* []
*
* > arrayify(null)
* [ null ]
*
* > arrayify(0)
* [ 0 ]
*
* > arrayify([ 1, 2 ])
* [ 1, 2 ]
*
* > arrayify(new Set([ 1, 2 ]))
* [ 1, 2 ]
*
* > function f(){ return arrayify(arguments); }
* > f(1,2,3)
* [ 1, 2, 3 ]
*/
function isObject (input) {
return typeof input === 'object' && input !== null
}
function isArrayLike (input) {
return isObject(input) && typeof input.length === 'number'
}
/**
* @param {*} - The input value to convert to an array
* @returns {Array}
* @alias module:array-back
*/
function arrayify (input) {
if (Array.isArray(input)) {
return input
}
if (input === undefined) {
return []
}
if (isArrayLike(input) || input instanceof Set) {
return Array.from(input)
}
return [ input ]
}
export default arrayify

View File

@@ -0,0 +1,46 @@
{
"name": "array-back",
"author": "Lloyd Brookes <75pound@gmail.com>",
"version": "3.1.0",
"description": "Guarantees an array back",
"repository": "https://github.com/75lb/array-back.git",
"license": "MIT",
"main": "dist/index.js",
"keywords": [
"to",
"convert",
"return",
"array",
"arrayify"
],
"engines": {
"node": ">=6"
},
"files": [
"index.mjs",
"dist/index.js"
],
"scripts": {
"test": "npm run test:esm && npm run test:js",
"test:esm": "node --experimental-modules test.mjs",
"test:js": "npm run dist:test && node dist/test.js",
"docs": "jsdoc2md -t README.hbs index.mjs -c build/jsdoc.conf > README.md; echo",
"cover": "nyc test-runner test.js && nyc report --reporter=text-lcov | coveralls",
"dist": "rollup -c build/index.config.js",
"dist:test": "rollup -c build/test.config.js",
"lint": "standard **/*.mjs"
},
"dependencies": {},
"devDependencies": {
"coveralls": "^3.0.3",
"jsdoc-to-markdown": "^4.0.1",
"rollup": "^1.9.0",
"test-runner": "^0.5.1"
},
"standard": {
"ignore": [
"dist",
"build"
]
}
}

View File

@@ -0,0 +1,33 @@
{
"name": "ansi-escape-sequences",
"author": "Lloyd Brookes <75pound@gmail.com>",
"version": "4.1.0",
"description": "A simple library containing all known terminal ansi escape codes and sequences.",
"repository": "https://github.com/75lb/ansi-escape-sequences.git",
"main": "dist/index.js",
"license": "MIT",
"keywords": [
"ansi",
"terminal",
"colour",
"color",
"command line",
"cursor"
],
"engines": {
"node": ">=8.0.0"
},
"scripts": {
"test": "test-runner test.js",
"docs": "jsdoc2md -c jsdoc.conf -d 1 -t README.hbs index.mjs > README.md; echo",
"dist": "rollup index.mjs -f umd -n ansi -o dist/index.js && rollup index.mjs -f esm -o dist/index.mjs"
},
"dependencies": {
"array-back": "^3.0.1"
},
"devDependencies": {
"jsdoc-to-markdown": "^4.0.1",
"rollup": "^1.4.1",
"test-runner": "^0.5.1"
}
}

12
.node-red/node_modules/ansi-escape-sequences/test.js generated vendored Normal file
View File

@@ -0,0 +1,12 @@
const TestRunner = require('test-runner')
const ansi = require('./')
const runner = new TestRunner()
const a = require('assert')
runner.test('format', function () {
a.strictEqual(ansi.format('clive', ['red', 'underline']), '\u001b[31;4mclive\u001b[0m')
})
runner.test('inline format', function () {
a.strictEqual(ansi.format('before [red underline]{clive} after'), 'before \u001b[31;4mclive\u001b[0m after')
})