Skip to content

Commit b363af8

Browse files
author
Peter Svetlichny
committed
chore(lint): add standard; fix lint errors
1 parent 6b31d51 commit b363af8

File tree

2,571 files changed

+190589
-25
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,571 files changed

+190589
-25
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"manifest": {
3+
"name": "ansi-escapes",
4+
"version": "1.4.0",
5+
"description": "ANSI escape codes for manipulating the terminal",
6+
"license": "MIT",
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/sindresorhus/ansi-escapes.git"
10+
},
11+
"author": {
12+
"name": "Sindre Sorhus",
13+
"email": "sindresorhus@gmail.com",
14+
"url": "sindresorhus.com"
15+
},
16+
"engines": {
17+
"node": ">=0.10.0"
18+
},
19+
"scripts": {
20+
"test": "xo && ava"
21+
},
22+
"files": [
23+
"index.js"
24+
],
25+
"keywords": [
26+
"ansi",
27+
"terminal",
28+
"console",
29+
"cli",
30+
"string",
31+
"tty",
32+
"escape",
33+
"escapes",
34+
"formatting",
35+
"shell",
36+
"xterm",
37+
"log",
38+
"logging",
39+
"command-line",
40+
"text",
41+
"vt100",
42+
"sequence",
43+
"control",
44+
"code",
45+
"codes",
46+
"cursor",
47+
"iterm",
48+
"iterm2"
49+
],
50+
"devDependencies": {
51+
"ava": "*",
52+
"xo": "*"
53+
},
54+
"_registry": "npm",
55+
"_loc": ".yarn-cache/v1/npm-ansi-escapes-1.4.0-d3a8a83b319aa67793662b13e761c7911422306e/package.json",
56+
"readmeFilename": "readme.md",
57+
"readme": "# ansi-escapes [![Build Status](https://travis-ci.org/sindresorhus/ansi-escapes.svg?branch=master)](https://travis-ci.org/sindresorhus/ansi-escapes)\n\n> [ANSI escape codes](http://www.termsys.demon.co.uk/vtansi.htm) for manipulating the terminal\n\n\n## Install\n\n```\n$ npm install --save ansi-escapes\n```\n\n\n## Usage\n\n```js\nconst ansiEscapes = require('ansi-escapes');\n\n// moves the cursor two rows up and to the left\nprocess.stdout.write(ansiEscapes.cursorUp(2) + ansiEscapes.cursorLeft);\n//=> '\\u001b[2A\\u001b[1000D'\n```\n\n\n## API\n\n### cursorTo([x, [y]])\n\nSet the absolute position of the cursor. `x0` `y0` is the top left of the screen.\n\nSpecify either both `x` & `y`, only `x`, or nothing.\n\n### cursorMove(x, [y])\n\nSet the position of the cursor relative to its current position.\n\n### cursorUp(count)\n\nMove cursor up a specific amount of rows. Default is `1`.\n\n### cursorDown(count)\n\nMove cursor down a specific amount of rows. Default is `1`.\n\n### cursorForward(count)\n\nMove cursor forward a specific amount of rows. Default is `1`.\n\n### cursorBackward(count)\n\nMove cursor backward a specific amount of rows. Default is `1`.\n\n### cursorLeft\n\nMove cursor to the left side.\n\n### cursorSavePosition\n\nSave cursor position.\n\n### cursorRestorePosition\n\nRestore saved cursor position.\n\n### cursorGetPosition\n\nGet cursor position.\n\n### cursorNextLine\n\nMove cursor to the next line.\n\n### cursorPrevLine\n\nMove cursor to the previous line.\n\n### cursorHide\n\nHide cursor.\n\n### cursorShow\n\nShow cursor.\n\n### eraseLines(count)\n\nErase from the current cursor position up the specified amount of rows.\n\n### eraseEndLine\n\nErase from the current cursor position to the end of the current line.\n\n### eraseStartLine\n\nErase from the current cursor position to the start of the current line.\n\n### eraseLine\n\nErase the entire current line.\n\n### eraseDown\n\nErase the screen from the current line down to the bottom of the screen.\n\n### eraseUp\n\nErase the screen from the current line up to the top of the screen.\n\n### eraseScreen\n\nErase the screen and move the cursor the top left position.\n\n### scrollUp\n\nScroll display up one line.\n\n### scrollDown\n\nScroll display down one line.\n\n### clearScreen\n\nClear the terminal screen.\n\n### beep\n\nOutput a beeping sound.\n\n### image(input, [options])\n\nDisplay an image.\n\n*Currently only supported on iTerm >=2.9.*\n\nSee [term-img](https://github.com/sindresorhus/term-img) for a higher-level module.\n\n#### input\n\nType: `buffer`\n\nBuffer of an image. Usually read in with `fs.readFile()`.\n\n#### options\n\n##### width\n##### height\n\nType: `string` `number`\n\nThe width and height are given as a number followed by a unit, or the word \"auto\".\n\n- `N`: N character cells.\n- `Npx`: N pixels.\n- `N%`: N percent of the session's width or height.\n- `auto`: The image's inherent size will be used to determine an appropriate dimension.\n\n##### preserveAspectRatio\n\nType: `boolean`<br>\nDefault: `true`\n\n### iTerm.setCwd([path])\n\nType: `string`<br>\nDefault: `process.cwd()`\n\n[Inform iTerm](https://www.iterm2.com/documentation-escape-codes.html) of the current directory to help semantic history and enable [Cmd-clicking relative paths](https://coderwall.com/p/b7e82q/quickly-open-files-in-iterm-with-cmd-click).\n\n\n## Related\n\n- [ansi-styles](https://github.com/chalk/ansi-styles) - ANSI escape codes for styling strings in the terminal\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n",
58+
"licenseText": "The MIT License (MIT)\n\nCopyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
59+
},
60+
"artifacts": [],
61+
"remote": {
62+
"resolved": "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e",
63+
"type": "tarball",
64+
"reference": "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz",
65+
"hash": "d3a8a83b319aa67793662b13e761c7911422306e",
66+
"registry": "npm",
67+
"packageName": "ansi-escapes"
68+
},
69+
"registry": "npm",
70+
"hash": "d3a8a83b319aa67793662b13e761c7911422306e"
71+
}
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
'use strict';
2+
var ESC = '\u001b[';
3+
var x = module.exports;
4+
5+
x.cursorTo = function (x, y) {
6+
if (arguments.length === 0) {
7+
return ESC + 'H';
8+
}
9+
10+
if (arguments.length === 1) {
11+
return ESC + (x + 1) + 'G';
12+
}
13+
14+
return ESC + (y + 1) + ';' + (x + 1) + 'H';
15+
};
16+
17+
x.cursorMove = function (x, y) {
18+
var ret = '';
19+
20+
if (x < 0) {
21+
ret += ESC + (-x) + 'D';
22+
} else if (x > 0) {
23+
ret += ESC + x + 'C';
24+
}
25+
26+
if (y < 0) {
27+
ret += ESC + (-y) + 'A';
28+
} else if (y > 0) {
29+
ret += ESC + y + 'B';
30+
}
31+
32+
return ret;
33+
};
34+
35+
x.cursorUp = function (count) {
36+
return ESC + (typeof count === 'number' ? count : 1) + 'A';
37+
};
38+
39+
x.cursorDown = function (count) {
40+
return ESC + (typeof count === 'number' ? count : 1) + 'B';
41+
};
42+
43+
x.cursorForward = function (count) {
44+
return ESC + (typeof count === 'number' ? count : 1) + 'C';
45+
};
46+
47+
x.cursorBackward = function (count) {
48+
return ESC + (typeof count === 'number' ? count : 1) + 'D';
49+
};
50+
51+
x.cursorLeft = ESC + '1000D';
52+
x.cursorSavePosition = ESC + 's';
53+
x.cursorRestorePosition = ESC + 'u';
54+
x.cursorGetPosition = ESC + '6n';
55+
x.cursorNextLine = ESC + 'E';
56+
x.cursorPrevLine = ESC + 'F';
57+
x.cursorHide = ESC + '?25l';
58+
x.cursorShow = ESC + '?25h';
59+
60+
x.eraseLines = function (count) {
61+
var clear = '';
62+
63+
for (var i = 0; i < count; i++) {
64+
clear += x.cursorLeft + x.eraseEndLine + (i < count - 1 ? x.cursorUp() : '');
65+
}
66+
67+
return clear;
68+
};
69+
70+
x.eraseEndLine = ESC + 'K';
71+
x.eraseStartLine = ESC + '1K';
72+
x.eraseLine = ESC + '2K';
73+
x.eraseDown = ESC + 'J';
74+
x.eraseUp = ESC + '1J';
75+
x.eraseScreen = ESC + '2J';
76+
x.scrollUp = ESC + 'S';
77+
x.scrollDown = ESC + 'T';
78+
79+
x.clearScreen = '\u001bc';
80+
x.beep = '\u0007';
81+
82+
x.image = function (buf, opts) {
83+
opts = opts || {};
84+
85+
var ret = '\u001b]1337;File=inline=1';
86+
87+
if (opts.width) {
88+
ret += ';width=' + opts.width;
89+
}
90+
91+
if (opts.height) {
92+
ret += ';height=' + opts.height;
93+
}
94+
95+
if (opts.preserveAspectRatio === false) {
96+
ret += ';preserveAspectRatio=0';
97+
}
98+
99+
return ret + ':' + buf.toString('base64') + '\u0007';
100+
};
101+
102+
x.iTerm = {};
103+
104+
x.iTerm.setCwd = function (cwd) {
105+
return '\u001b]50;CurrentDir=' + (cwd || process.cwd()) + '\u0007';
106+
};
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"name": "ansi-escapes",
3+
"version": "1.4.0",
4+
"description": "ANSI escape codes for manipulating the terminal",
5+
"license": "MIT",
6+
"repository": "sindresorhus/ansi-escapes",
7+
"author": {
8+
"name": "Sindre Sorhus",
9+
"email": "sindresorhus@gmail.com",
10+
"url": "sindresorhus.com"
11+
},
12+
"engines": {
13+
"node": ">=0.10.0"
14+
},
15+
"scripts": {
16+
"test": "xo && ava"
17+
},
18+
"files": [
19+
"index.js"
20+
],
21+
"keywords": [
22+
"ansi",
23+
"terminal",
24+
"console",
25+
"cli",
26+
"string",
27+
"tty",
28+
"escape",
29+
"escapes",
30+
"formatting",
31+
"shell",
32+
"xterm",
33+
"log",
34+
"logging",
35+
"command-line",
36+
"text",
37+
"vt100",
38+
"sequence",
39+
"control",
40+
"code",
41+
"codes",
42+
"cursor",
43+
"iterm",
44+
"iterm2"
45+
],
46+
"devDependencies": {
47+
"ava": "*",
48+
"xo": "*"
49+
}
50+
}

0 commit comments

Comments
 (0)