Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
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 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. # 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 columns. Default is `1`.
  25. ### cursorBackward(count)
  26. Move cursor backward a specific amount of columns. 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(filePath, 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. Type: `object`
  79. ##### width
  80. ##### height
  81. Type: `string | number`
  82. The width and height are given as a number followed by a unit, or the word "auto".
  83. - `N`: N character cells.
  84. - `Npx`: N pixels.
  85. - `N%`: N percent of the session's width or height.
  86. - `auto`: The image's inherent size will be used to determine an appropriate dimension.
  87. ##### preserveAspectRatio
  88. Type: `boolean`\
  89. Default: `true`
  90. ### iTerm.setCwd(path?)
  91. Type: `string`\
  92. Default: `process.cwd()`
  93. [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).
  94. ### iTerm.annotation(message, options?)
  95. Creates an escape code to display an "annotation" in iTerm2.
  96. An annotation looks like this when shown:
  97. <img src="https://user-images.githubusercontent.com/924465/64382136-b60ac700-cfe9-11e9-8a35-9682e8dc4b72.png" width="500">
  98. See the [iTerm Proprietary Escape Codes documentation](https://iterm2.com/documentation-escape-codes.html) for more information.
  99. #### message
  100. Type: `string`
  101. The message to display within the annotation.
  102. The `|` character is disallowed and will be stripped.
  103. #### options
  104. Type: `object`
  105. ##### length
  106. Type: `number`\
  107. Default: The remainder of the line
  108. Nonzero number of columns to annotate.
  109. ##### x
  110. Type: `number`\
  111. Default: Cursor position
  112. Starting X coordinate.
  113. Must be used with `y` and `length`.
  114. ##### y
  115. Type: `number`\
  116. Default: Cursor position
  117. Starting Y coordinate.
  118. Must be used with `x` and `length`.
  119. ##### isHidden
  120. Type: `boolean`\
  121. Default: `false`
  122. Create a "hidden" annotation.
  123. Annotations created this way can be shown using the "Show Annotations" iTerm command.
  124. ## Related
  125. - [ansi-styles](https://github.com/chalk/ansi-styles) - ANSI escape codes for styling strings in the terminal
  126. ---
  127. <div align="center">
  128. <b>
  129. <a href="https://tidelift.com/subscription/pkg/npm-ansi-escapes?utm_source=npm-ansi-escapes&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
  130. </b>
  131. <br>
  132. <sub>
  133. Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
  134. </sub>
  135. </div>