mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-21 05:24:45 +00:00
.
This commit is contained in:
parent
fc725ba36b
commit
422b9fdb15
7395 changed files with 1786235 additions and 3476 deletions
21
node_modules/sisteransi/license
generated
vendored
Normal file
21
node_modules/sisteransi/license
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2018 Terkel Gjervig Nielsen
|
||||
|
||||
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.
|
37
node_modules/sisteransi/package.json
generated
vendored
Executable file
37
node_modules/sisteransi/package.json
generated
vendored
Executable file
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"name": "sisteransi",
|
||||
"version": "1.0.0",
|
||||
"description": "ANSI escape codes for some terminal swag",
|
||||
"main": "src/index.js",
|
||||
"license": "MIT",
|
||||
"author": {
|
||||
"name": "Terkel Gjervig",
|
||||
"email": "terkel@terkel.com",
|
||||
"url": "https://terkel.com"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tape test/*.js | tap-spec"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/terkelg/sisteransi"
|
||||
},
|
||||
"files": [
|
||||
"src"
|
||||
],
|
||||
"keywords": [
|
||||
"ansi",
|
||||
"escape codes",
|
||||
"escape",
|
||||
"terminal",
|
||||
"style"
|
||||
],
|
||||
"devDependencies": {
|
||||
"tap-spec": "^5.0.0",
|
||||
"tape": "^4.9.0"
|
||||
}
|
||||
|
||||
,"_resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.0.tgz"
|
||||
,"_integrity": "sha512-N+z4pHB4AmUv0SjveWRd6q1Nj5w62m5jodv+GD8lvmbY/83T/rpbJGZOnK5T149OldDj4Db07BSv9xY4K6NTPQ=="
|
||||
,"_from": "sisteransi@1.0.0"
|
||||
}
|
105
node_modules/sisteransi/readme.md
generated
vendored
Executable file
105
node_modules/sisteransi/readme.md
generated
vendored
Executable file
|
@ -0,0 +1,105 @@
|
|||
# sister ANSI [](https://www.npmjs.com/package/sisteransi) [](https://travis-ci.org/terkelg/sisteransi) [](https://www.npmjs.com/package/sisteransi)
|
||||
|
||||
> Ansi escape codes faster than you can say "[Bam bam](https://www.youtube.com/watch?v=OcaPu9JPenU)".
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
npm install sisteransi
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const ansi = require('sisteransi');
|
||||
// or const { cursor } = require('sisteransi');
|
||||
|
||||
const p = str => process.stdout.write(str);
|
||||
|
||||
// move cursor to 2, 1
|
||||
p(ansi.cursor.to(2, 1));
|
||||
|
||||
// to up, one down
|
||||
p(ansi.cursor.up(2)+ansi.cursor.down(1));
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### cursor
|
||||
|
||||
#### to(x, y)
|
||||
Set the absolute position of the cursor. `x0` `y0` is the top left of the screen.
|
||||
|
||||
#### move(x, y)
|
||||
Set the position of the cursor relative to its current position.
|
||||
|
||||
#### up(count = 1)
|
||||
Move cursor up a specific amount of rows. Default is `1`.
|
||||
|
||||
#### down(count = 1)
|
||||
Move cursor down a specific amount of rows. Default is `1`.
|
||||
|
||||
#### forward(count = 1)
|
||||
Move cursor forward a specific amount of rows. Default is `1`.
|
||||
|
||||
#### backward(count = 1)
|
||||
Move cursor backward a specific amount of rows. Default is `1`.
|
||||
|
||||
#### nextLine(count = 1)
|
||||
Move cursor to the next line a specific amount of lines. Default is `1`.
|
||||
|
||||
#### prevLine(count = 1)
|
||||
Move cursor to the previous a specific amount of lines. Default is `1`.
|
||||
|
||||
#### left
|
||||
Move cursor to the left side.
|
||||
|
||||
#### hide
|
||||
Hide cursor.
|
||||
|
||||
#### show
|
||||
Show cursor.
|
||||
|
||||
|
||||
### scroll
|
||||
|
||||
#### up(count = 1)
|
||||
Scroll display up a specific amount of lines. Default to `1`.
|
||||
|
||||
#### down(count = 1)
|
||||
Scroll display down a specific amount of lines. Default to `1`.
|
||||
|
||||
|
||||
### erase
|
||||
|
||||
#### screen
|
||||
Erase the screen and move the cursor the top left position.
|
||||
|
||||
#### up(count = 1)
|
||||
Erase the screen from the current line up to the top of the screen. Default to `1`.
|
||||
|
||||
#### down(count = 2)
|
||||
Erase the screen from the current line down to the bottom of the screen. Default to `1`.
|
||||
|
||||
#### line
|
||||
Erase the entire current line.
|
||||
|
||||
#### lineEnd
|
||||
Erase from the current cursor position to the end of the current line.
|
||||
|
||||
#### lineStart
|
||||
Erase from the current cursor position to the start of the current line.
|
||||
|
||||
#### lines(count)
|
||||
Erase from the current cursor position up the specified amount of rows.
|
||||
|
||||
|
||||
## Credit
|
||||
|
||||
This is a fork of [ansi-escapes](https://github.com/sindresorhus/ansi-escapes).
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Terkel Gjervig](https://terkel.com)
|
56
node_modules/sisteransi/src/index.js
generated
vendored
Normal file
56
node_modules/sisteransi/src/index.js
generated
vendored
Normal file
|
@ -0,0 +1,56 @@
|
|||
'use strict';
|
||||
|
||||
const ESC = '\u001B[';
|
||||
const clear = '\u0007';
|
||||
const beep = '\u0007';
|
||||
|
||||
const cursor = {
|
||||
to(x, y) {
|
||||
if (!y) return `${ESC}${x + 1}G`;
|
||||
return `${ESC}${y + 1};${x + 1}H`;
|
||||
},
|
||||
move(x, y) {
|
||||
let ret = '';
|
||||
|
||||
if (x < 0) ret += `${ESC}${-x}D`;
|
||||
else if (x > 0) ret += `${ESC}${x}C`;
|
||||
|
||||
if (y < 0) ret += `${ESC}${-y}A`;
|
||||
else if (y > 0) ret += `${ESC}${y}B`;
|
||||
|
||||
return ret;
|
||||
},
|
||||
up: (count = 1) => `${ESC}${count}A`,
|
||||
down: (count = 1) => `${ESC}${count}B`,
|
||||
forward: (count = 1) => `${ESC}${count}C`,
|
||||
backward: (count = 1) => `${ESC}${count}D`,
|
||||
nextLine: (count = 1) => `${ESC}E`.repeat(count),
|
||||
prevLine: (count = 1) => `${ESC}F`.repeat(count),
|
||||
left: `${ESC}G`,
|
||||
hide: `${ESC}?25l`,
|
||||
show: `${ESC}?25h`
|
||||
}
|
||||
|
||||
const scroll = {
|
||||
up: (count = 1) => `${ESC}S`.repeat(count),
|
||||
down: (count = 1) => `${ESC}T`.repeat(count)
|
||||
}
|
||||
|
||||
const erase = {
|
||||
screen: `${ESC}2J`,
|
||||
up: (count = 1) => `${ESC}1J`.repeat(count),
|
||||
down: (count = 1) => `${ESC}J`.repeat(count),
|
||||
line: `${ESC}2K`,
|
||||
lineEnd: `${ESC}K`,
|
||||
lineStart: `${ESC}1K`,
|
||||
lines(count) {
|
||||
let clear = '';
|
||||
for (let i = 0; i < count; i++)
|
||||
clear += this.line + (i < count - 1 ? cursor.up() : '');
|
||||
if (count)
|
||||
clear += cursor.left;
|
||||
return clear;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { cursor, scroll, erase, beep, clear };
|
Loading…
Add table
Add a link
Reference in a new issue