Add initial version of dijkstra backend cloudron image
This commit is contained in:
7
node_modules/colorette/LICENSE.md
generated
vendored
Normal file
7
node_modules/colorette/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
Copyright © Jorge Bucaran <<https://jorgebucaran.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.
|
||||
117
node_modules/colorette/README.md
generated
vendored
Normal file
117
node_modules/colorette/README.md
generated
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
# Colorette [](https://www.npmjs.org/package/colorette) [](https://travis-ci.org/jorgebucaran/colorette)
|
||||
|
||||
> Color your terminal using pure idiomatic JavaScript.
|
||||
|
||||
Colorette is a Node.js library for embellishing your CLI tools with colors and styles using [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code).
|
||||
|
||||
- Up to ~10x faster than the alternatives ([run the benchmarks](#run-the-benchmarks)).
|
||||
- No wonky prototype-based method chains.
|
||||
- Automatic color support detection.
|
||||
- ~80 LOC and no dependencies.
|
||||
- [`NO_COLOR`](https://no-color.org) friendly.
|
||||
|
||||
## Quickstart
|
||||
|
||||
```console
|
||||
npm i colorette
|
||||
```
|
||||
|
||||
Load the [styles](#styles) you need. [Here](#supported-styles)'s the list of the styles you can use.
|
||||
|
||||
```js
|
||||
const { red, blue, bold } = require("colorette")
|
||||
```
|
||||
|
||||
Wrap your strings in one or more styles to produce the finish you're looking for.
|
||||
|
||||
```js
|
||||
console.log(bold(blue("Engage!")))
|
||||
```
|
||||
|
||||
Or mix it with [template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) to interpolate variables, expressions and create multi-line strings easily.
|
||||
|
||||
```js
|
||||
console.log(`
|
||||
Beets are ${red("red")},
|
||||
Plums are ${blue("blue")},
|
||||
${bold("Colorette!")}.
|
||||
`)
|
||||
```
|
||||
|
||||
Using `console.log`'s [string substitution](https://nodejs.org/api/console.html#console_console_log_data_args) can be useful too!
|
||||
|
||||
```js
|
||||
console.log(bold("Total: $%f"), 1.99)
|
||||
```
|
||||
|
||||
You can even nest styles without breaking existing escape codes.
|
||||
|
||||
```js
|
||||
console.log(red(`Red Shirt ${blue("Blue Shirt")} Red Shirt`))
|
||||
```
|
||||
|
||||
Feeling adventurous? Try the [pipeline operator](https://github.com/tc39/proposal-pipeline-operator).
|
||||
|
||||
```js
|
||||
console.log("Make it so!" |> bold |> blue)
|
||||
```
|
||||
|
||||
## Supported styles
|
||||
|
||||
Colorette supports the standard and bright color variations out-of-the-box. For true color support see [this issue](https://github.com/jorgebucaran/colorette/issues/27).
|
||||
|
||||
| Colors | Background Colors | Bright Colors | Bright Background Colors | Modifiers |
|
||||
| ------- | ----------------- | ------------- | ------------------------ | ----------------- |
|
||||
| black | bgBlack | blackBright | bgBlackBright | dim |
|
||||
| red | bgRed | redBright | bgRedBright | **bold** |
|
||||
| green | bgGreen | greenBright | bgGreenBright | hidden |
|
||||
| yellow | bgYellow | yellowBright | bgYellowBright | _italic_ |
|
||||
| blue | bgBlue | blueBright | bgBlueBright | underline |
|
||||
| magenta | bgMagenta | magentaBright | bgMagentaBright | ~~strikethrough~~ |
|
||||
| cyan | bgCyan | cyanBright | bgCyanBright | reset |
|
||||
| white | bgWhite | whiteBright | bgWhiteBright | |
|
||||
| gray | | | | |
|
||||
|
||||
## API
|
||||
|
||||
### <code><i>style</i>(string)</code>
|
||||
|
||||
Returns a string wrapped in the corresponding ANSI escape code.
|
||||
|
||||
```js
|
||||
red("Red Alert") //=> \u001b[31mRed Alert\u001b[39m
|
||||
```
|
||||
|
||||
### `options.enabled`
|
||||
|
||||
Colorette is enabled if your terminal supports color, `FORCE_COLOR=1` or if `NO_COLOR` isn't in the environment, but you can always override it when you need to.
|
||||
|
||||
```js
|
||||
const { options } = require("colorette")
|
||||
|
||||
options.enabled = false
|
||||
```
|
||||
|
||||
## Run the benchmarks
|
||||
|
||||
```
|
||||
npm i -C bench && node bench
|
||||
```
|
||||
|
||||
<pre>
|
||||
# Using Styles
|
||||
chalk × 14,468 ops/sec
|
||||
colorette × 901,148 ops/sec
|
||||
|
||||
# Combining Styles
|
||||
chalk × 44,067 ops/sec
|
||||
colorette × 2,566,778 ops/sec
|
||||
|
||||
# Nesting Styles
|
||||
chalk × 40,165 ops/sec
|
||||
colorette × 506,494 ops/sec
|
||||
</pre>
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE.md)
|
||||
48
node_modules/colorette/colorette.d.ts
generated
vendored
Normal file
48
node_modules/colorette/colorette.d.ts
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
interface Style {
|
||||
(string: string): string
|
||||
}
|
||||
|
||||
export const options: {
|
||||
enabled: boolean
|
||||
}
|
||||
export const reset: Style
|
||||
export const bold: Style
|
||||
export const dim: Style
|
||||
export const italic: Style
|
||||
export const underline: Style
|
||||
export const inverse: Style
|
||||
export const hidden: Style
|
||||
export const strikethrough: Style
|
||||
export const black: Style
|
||||
export const red: Style
|
||||
export const green: Style
|
||||
export const yellow: Style
|
||||
export const blue: Style
|
||||
export const magenta: Style
|
||||
export const cyan: Style
|
||||
export const white: Style
|
||||
export const gray: Style
|
||||
export const bgBlack: Style
|
||||
export const bgRed: Style
|
||||
export const bgGreen: Style
|
||||
export const bgYellow: Style
|
||||
export const bgBlue: Style
|
||||
export const bgMagenta: Style
|
||||
export const bgCyan: Style
|
||||
export const bgWhite: Style
|
||||
export const blackBright: Style
|
||||
export const redBright: Style
|
||||
export const greenBright: Style
|
||||
export const yellowBright: Style
|
||||
export const blueBright: Style
|
||||
export const magentaBright: Style
|
||||
export const cyanBright: Style
|
||||
export const whiteBright: Style
|
||||
export const bgBlackBright: Style
|
||||
export const bgRedBright: Style
|
||||
export const bgGreenBright: Style
|
||||
export const bgYellowBright: Style
|
||||
export const bgBlueBright: Style
|
||||
export const bgMagentaBright: Style
|
||||
export const bgCyanBright: Style
|
||||
export const bgWhiteBright: Style
|
||||
76
node_modules/colorette/index.js
generated
vendored
Normal file
76
node_modules/colorette/index.js
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
"use strict"
|
||||
|
||||
let enabled =
|
||||
!("NO_COLOR" in process.env) &&
|
||||
process.env.FORCE_COLOR !== "0" &&
|
||||
(process.platform === "win32" ||
|
||||
(process.stdout != null &&
|
||||
process.stdout.isTTY &&
|
||||
process.env.TERM &&
|
||||
process.env.TERM !== "dumb"))
|
||||
|
||||
const rawInit = (open, close, searchRegex, replaceValue) => s =>
|
||||
enabled
|
||||
? open +
|
||||
(~(s += "").indexOf(close, 4) // skip opening \x1b[
|
||||
? s.replace(searchRegex, replaceValue)
|
||||
: s) +
|
||||
close
|
||||
: s
|
||||
|
||||
const init = (open, close) => {
|
||||
return rawInit(
|
||||
`\x1b[${open}m`,
|
||||
`\x1b[${close}m`,
|
||||
new RegExp(`\\x1b\\[${close}m`, "g"),
|
||||
`\x1b[${open}m`
|
||||
)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
options: Object.defineProperty({}, "enabled", {
|
||||
get: () => enabled,
|
||||
set: value => (enabled = value)
|
||||
}),
|
||||
reset: init(0, 0),
|
||||
bold: rawInit("\x1b[1m", "\x1b[22m", /\x1b\[22m/g, "\x1b[22m\x1b[1m"),
|
||||
dim: rawInit("\x1b[2m", "\x1b[22m", /\x1b\[22m/g, "\x1b[22m\x1b[2m"),
|
||||
italic: init(3, 23),
|
||||
underline: init(4, 24),
|
||||
inverse: init(7, 27),
|
||||
hidden: init(8, 28),
|
||||
strikethrough: init(9, 29),
|
||||
black: init(30, 39),
|
||||
red: init(31, 39),
|
||||
green: init(32, 39),
|
||||
yellow: init(33, 39),
|
||||
blue: init(34, 39),
|
||||
magenta: init(35, 39),
|
||||
cyan: init(36, 39),
|
||||
white: init(37, 39),
|
||||
gray: init(90, 39),
|
||||
bgBlack: init(40, 49),
|
||||
bgRed: init(41, 49),
|
||||
bgGreen: init(42, 49),
|
||||
bgYellow: init(43, 49),
|
||||
bgBlue: init(44, 49),
|
||||
bgMagenta: init(45, 49),
|
||||
bgCyan: init(46, 49),
|
||||
bgWhite: init(47, 49),
|
||||
blackBright: init(90, 39),
|
||||
redBright: init(91, 39),
|
||||
greenBright: init(92, 39),
|
||||
yellowBright: init(93, 39),
|
||||
blueBright: init(94, 39),
|
||||
magentaBright: init(95, 39),
|
||||
cyanBright: init(96, 39),
|
||||
whiteBright: init(97, 39),
|
||||
bgBlackBright: init(100, 49),
|
||||
bgRedBright: init(101, 49),
|
||||
bgGreenBright: init(102, 49),
|
||||
bgYellowBright: init(103, 49),
|
||||
bgBlueBright: init(104, 49),
|
||||
bgMagentaBright: init(105, 49),
|
||||
bgCyanBright: init(106, 49),
|
||||
bgWhiteBright: init(107, 49)
|
||||
}
|
||||
66
node_modules/colorette/package.json
generated
vendored
Normal file
66
node_modules/colorette/package.json
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"colorette@1.1.0",
|
||||
"/home/rui/code/personal/dijkstra-app/backend-dijkstra"
|
||||
]
|
||||
],
|
||||
"_from": "colorette@1.1.0",
|
||||
"_id": "colorette@1.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-6S062WDQUXi6hOfkO/sBPVwE5ASXY4G2+b4atvhJfSsuUUhIaUKlkjLe9692Ipyt5/a+IPF5aVTu3V5gvXq5cg==",
|
||||
"_location": "/colorette",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "colorette@1.1.0",
|
||||
"name": "colorette",
|
||||
"escapedName": "colorette",
|
||||
"rawSpec": "1.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/knex"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/colorette/-/colorette-1.1.0.tgz",
|
||||
"_spec": "1.1.0",
|
||||
"_where": "/home/rui/code/personal/dijkstra-app/backend-dijkstra",
|
||||
"author": {
|
||||
"name": "Jorge Bucaran"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jorgebucaran/colorette/issues"
|
||||
},
|
||||
"description": "Color your terminal using pure idiomatic JavaScript.",
|
||||
"devDependencies": {
|
||||
"nyc": "14.1.1",
|
||||
"testmatrix": "0.1.2"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"colorette.d.ts"
|
||||
],
|
||||
"homepage": "https://github.com/jorgebucaran/colorette",
|
||||
"keywords": [
|
||||
"colorette",
|
||||
"terminal",
|
||||
"styles",
|
||||
"color",
|
||||
"ansi"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "colorette",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/jorgebucaran/colorette.git"
|
||||
},
|
||||
"scripts": {
|
||||
"release": "v=$npm_package_version; git commit -am $v && git tag -s $v -m $v && git push && git push --tags && npm publish",
|
||||
"test": "nyc -r lcov testmatrix test/index.js"
|
||||
},
|
||||
"types": "colorette.d.ts",
|
||||
"version": "1.1.0"
|
||||
}
|
||||
Reference in New Issue
Block a user