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 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. # sister ANSI [![Version](https://img.shields.io/npm/v/sisteransi.svg)](https://www.npmjs.com/package/sisteransi) [![Build Status](https://travis-ci.org/terkelg/sisteransi.svg?branch=master)](https://travis-ci.org/terkelg/sisteransi) [![Downloads](https://img.shields.io/npm/dm/sisteransi.svg)](https://www.npmjs.com/package/sisteransi)
  2. > Ansi escape codes faster than you can say "[Bam bam](https://www.youtube.com/watch?v=OcaPu9JPenU)".
  3. ## Installation
  4. ```
  5. npm install sisteransi
  6. ```
  7. ## Usage
  8. ```js
  9. const ansi = require('sisteransi');
  10. // or const { cursor } = require('sisteransi');
  11. const p = str => process.stdout.write(str);
  12. // move cursor to 2, 1
  13. p(ansi.cursor.to(2, 1));
  14. // to up, one down
  15. p(ansi.cursor.up(2)+ansi.cursor.down(1));
  16. ```
  17. ## API
  18. ### cursor
  19. #### to(x, y)
  20. Set the absolute position of the cursor. `x0` `y0` is the top left of the screen.
  21. #### move(x, y)
  22. Set the position of the cursor relative to its current position.
  23. #### up(count = 1)
  24. Move cursor up a specific amount of rows. Default is `1`.
  25. #### down(count = 1)
  26. Move cursor down a specific amount of rows. Default is `1`.
  27. #### forward(count = 1)
  28. Move cursor forward a specific amount of rows. Default is `1`.
  29. #### backward(count = 1)
  30. Move cursor backward a specific amount of rows. Default is `1`.
  31. #### nextLine(count = 1)
  32. Move cursor to the next line a specific amount of lines. Default is `1`.
  33. #### prevLine(count = 1)
  34. Move cursor to the previous a specific amount of lines. Default is `1`.
  35. #### left
  36. Move cursor to the left side.
  37. #### hide
  38. Hide cursor.
  39. #### show
  40. Show cursor.
  41. #### save
  42. Save cursor position.
  43. #### restore
  44. Restore cursor position.
  45. ### scroll
  46. #### up(count = 1)
  47. Scroll display up a specific amount of lines. Default to `1`.
  48. #### down(count = 1)
  49. Scroll display down a specific amount of lines. Default to `1`.
  50. ### erase
  51. #### screen
  52. Erase the screen and move the cursor the top left position.
  53. #### up(count = 1)
  54. Erase the screen from the current line up to the top of the screen. Default to `1`.
  55. #### down(count = 2)
  56. Erase the screen from the current line down to the bottom of the screen. Default to `1`.
  57. #### line
  58. Erase the entire current line.
  59. #### lineEnd
  60. Erase from the current cursor position to the end of the current line.
  61. #### lineStart
  62. Erase from the current cursor position to the start of the current line.
  63. #### lines(count)
  64. Erase from the current cursor position up the specified amount of rows.
  65. ## Credit
  66. This is a fork of [ansi-escapes](https://github.com/sindresorhus/ansi-escapes).
  67. ## License
  68. MIT © [Terkel Gjervig](https://terkel.com)