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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. # vfile-message
  2. [![Build][build-badge]][build]
  3. [![Coverage][coverage-badge]][coverage]
  4. [![Downloads][downloads-badge]][downloads]
  5. [![Size][size-badge]][size]
  6. [![Sponsors][sponsors-badge]][collective]
  7. [![Backers][backers-badge]][collective]
  8. [![Chat][chat-badge]][chat]
  9. Create [vfile][] messages.
  10. ## Install
  11. [npm][]:
  12. ```bash
  13. npm install vfile-message
  14. ```
  15. ## Use
  16. ```js
  17. var VMessage = require('vfile-message')
  18. var message = new VMessage(
  19. '`braavo` is misspelt; did you mean `bravo`?',
  20. {line: 1, column: 8},
  21. 'spell:typo'
  22. )
  23. console.log(message)
  24. ```
  25. Yields:
  26. ```js
  27. { [1:8: `braavo` is misspelt; did you mean `bravo`?]
  28. reason: '`braavo` is misspelt; did you mean `bravo`?',
  29. fatal: null,
  30. line: 1,
  31. column: 8,
  32. location:
  33. { start: { line: 1, column: 8 },
  34. end: { line: null, column: null } },
  35. source: 'spell',
  36. ruleId: 'typo' }
  37. ```
  38. ## API
  39. ### `VMessage(reason[, position][, origin])`
  40. Constructor of a message for `reason` at `position` from `origin`.
  41. When an error is passed in as `reason`, copies the stack.
  42. ##### Parameters
  43. ###### `reason`
  44. Reason for message (`string` or `Error`).
  45. Uses the stack and message of the error if given.
  46. ###### `position`
  47. Place at which the message occurred in a file ([`Node`][node],
  48. [`Position`][position], or [`Point`][point], optional).
  49. ###### `origin`
  50. Place in code the message originates from (`string`, optional).
  51. Can either be the [`ruleId`][ruleid] (`'rule'`), or a string with both a
  52. [`source`][source] and a [`ruleId`][ruleid] delimited with a colon
  53. (`'source:rule'`).
  54. ##### Extends
  55. [`Error`][error].
  56. ##### Returns
  57. An instance of itself.
  58. ##### Properties
  59. ###### `reason`
  60. Reason for message (`string`).
  61. ###### `fatal`
  62. If `true`, marks associated file as no longer processable (`boolean?`).
  63. If `false`, necessitates a (potential) change.
  64. The value can also be `null` or `undefined`.
  65. ###### `line`
  66. Starting line of error (`number?`).
  67. ###### `column`
  68. Starting column of error (`number?`).
  69. ###### `location`
  70. Full range information, when available ([`Position`][position]).
  71. Has `start` and `end` properties, both set to an object with `line` and
  72. `column`, set to `number?`.
  73. ###### `source`
  74. Namespace of warning (`string?`).
  75. ###### `ruleId`
  76. Category of message (`string?`).
  77. ###### `stack`
  78. Stack of message (`string?`).
  79. ##### Custom properties
  80. It’s OK to store custom data directly on the `VMessage`, some of those are
  81. handled by [utilities][util].
  82. ###### `file`
  83. You may add a `file` property with a path of a file (used throughout the
  84. [**VFile**][vfile] ecosystem).
  85. ###### `note`
  86. You may add a `note` property with a long form description of the message
  87. (supported by [`vfile-reporter`][reporter]).
  88. ###### `url`
  89. You may add a `url` property with a link to documentation for the message.
  90. ## Contribute
  91. See [`contributing.md`][contributing] in [`vfile/.github`][health] for ways to
  92. get started.
  93. See [`support.md`][support] for ways to get help.
  94. This project has a [code of conduct][coc].
  95. By interacting with this repository, organization, or community you agree to
  96. abide by its terms.
  97. ## License
  98. [MIT][license] © [Titus Wormer][author]
  99. <!-- Definitions -->
  100. [build-badge]: https://img.shields.io/travis/vfile/vfile-message.svg
  101. [build]: https://travis-ci.org/vfile/vfile-message
  102. [coverage-badge]: https://img.shields.io/codecov/c/github/vfile/vfile-message.svg
  103. [coverage]: https://codecov.io/github/vfile/vfile-message
  104. [downloads-badge]: https://img.shields.io/npm/dm/vfile-message.svg
  105. [downloads]: https://www.npmjs.com/package/vfile-message
  106. [size-badge]: https://img.shields.io/bundlephobia/minzip/vfile-message.svg
  107. [size]: https://bundlephobia.com/result?p=vfile-message
  108. [sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
  109. [backers-badge]: https://opencollective.com/unified/backers/badge.svg
  110. [collective]: https://opencollective.com/unified
  111. [chat-badge]: https://img.shields.io/badge/chat-spectrum-7b16ff.svg
  112. [chat]: https://spectrum.chat/unified/vfile
  113. [npm]: https://docs.npmjs.com/cli/install
  114. [contributing]: https://github.com/vfile/.github/blob/master/contributing.md
  115. [support]: https://github.com/vfile/.github/blob/master/support.md
  116. [health]: https://github.com/vfile/.github
  117. [coc]: https://github.com/vfile/.github/blob/master/code-of-conduct.md
  118. [license]: license
  119. [author]: https://wooorm.com
  120. [error]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error
  121. [node]: https://github.com/syntax-tree/unist#node
  122. [position]: https://github.com/syntax-tree/unist#position
  123. [point]: https://github.com/syntax-tree/unist#point
  124. [vfile]: https://github.com/vfile/vfile
  125. [util]: https://github.com/vfile/vfile#utilities
  126. [reporter]: https://github.com/vfile/vfile-reporter
  127. [ruleid]: #ruleid
  128. [source]: #source