Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

readme.md 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. # ansi-escapes [![Build Status](https://travis-ci.org/sindresorhus/ansi-escapes.svg?branch=master)](https://travis-ci.org/sindresorhus/ansi-escapes)
  2. > [ANSI escape codes](http://www.termsys.demon.co.uk/vtansi.htm) for manipulating the terminal
  3. ## Install
  4. ```
  5. $ npm install ansi-escapes
  6. ```
  7. ## Usage
  8. ```js
  9. const ansiEscapes = require('ansi-escapes');
  10. // Moves the cursor two rows up and to the left
  11. process.stdout.write(ansiEscapes.cursorUp(2) + ansiEscapes.cursorLeft);
  12. //=> '\u001B[2A\u001B[1000D'
  13. ```
  14. ## API
  15. ### cursorTo(x, [y])
  16. Set the absolute position of the cursor. `x0` `y0` is the top left of the screen.
  17. ### cursorMove(x, [y])
  18. Set the position of the cursor relative to its current position.
  19. ### cursorUp(count)
  20. Move cursor up a specific amount of rows. Default is `1`.
  21. ### cursorDown(count)
  22. Move cursor down a specific amount of rows. Default is `1`.
  23. ### cursorForward(count)
  24. Move cursor forward a specific amount of rows. Default is `1`.
  25. ### cursorBackward(count)
  26. Move cursor backward a specific amount of rows. Default is `1`.
  27. ### cursorLeft
  28. Move cursor to the left side.
  29. ### cursorSavePosition
  30. Save cursor position.
  31. ### cursorRestorePosition
  32. Restore saved cursor position.
  33. ### cursorGetPosition
  34. Get cursor position.
  35. ### cursorNextLine
  36. Move cursor to the next line.
  37. ### cursorPrevLine
  38. Move cursor to the previous line.
  39. ### cursorHide
  40. Hide cursor.
  41. ### cursorShow
  42. Show cursor.
  43. ### eraseLines(count)
  44. Erase from the current cursor position up the specified amount of rows.
  45. ### eraseEndLine
  46. Erase from the current cursor position to the end of the current line.
  47. ### eraseStartLine
  48. Erase from the current cursor position to the start of the current line.
  49. ### eraseLine
  50. Erase the entire current line.
  51. ### eraseDown
  52. Erase the screen from the current line down to the bottom of the screen.
  53. ### eraseUp
  54. Erase the screen from the current line up to the top of the screen.
  55. ### eraseScreen
  56. Erase the screen and move the cursor the top left position.
  57. ### scrollUp
  58. Scroll display up one line.
  59. ### scrollDown
  60. Scroll display down one line.
  61. ### clearScreen
  62. Clear the terminal screen. (Viewport)
  63. ### clearTerminal
  64. Clear the whole terminal, including scrollback buffer. (Not just the visible part of it)
  65. ### beep
  66. Output a beeping sound.
  67. ### link(text, url)
  68. Create a clickable link.
  69. [Supported terminals.](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda) Use [`supports-hyperlinks`](https://github.com/jamestalmage/supports-hyperlinks) to detect link support.
  70. ### image(input, [options])
  71. Display an image.
  72. *Currently only supported on iTerm2 >=3*
  73. See [term-img](https://github.com/sindresorhus/term-img) for a higher-level module.
  74. #### input
  75. Type: `Buffer`
  76. Buffer of an image. Usually read in with `fs.readFile()`.
  77. #### options
  78. ##### width
  79. ##### height
  80. Type: `string` `number`
  81. The width and height are given as a number followed by a unit, or the word "auto".
  82. - `N`: N character cells.
  83. - `Npx`: N pixels.
  84. - `N%`: N percent of the session's width or height.
  85. - `auto`: The image's inherent size will be used to determine an appropriate dimension.
  86. ##### preserveAspectRatio
  87. Type: `boolean`<br>
  88. Default: `true`
  89. ### iTerm.setCwd([path])
  90. Type: `string`<br>
  91. Default: `process.cwd()`
  92. [Inform iTerm2](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).
  93. ## Related
  94. - [ansi-styles](https://github.com/chalk/ansi-styles) - ANSI escape codes for styling strings in the terminal
  95. ## License
  96. MIT © [Sindre Sorhus](https://sindresorhus.com)