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.

12345678910111213141516171819202122232425262728293031323334
  1. 'use strict';
  2. const {stdin} = process;
  3. module.exports = async () => {
  4. let result = '';
  5. if (stdin.isTTY) {
  6. return result;
  7. }
  8. stdin.setEncoding('utf8');
  9. for await (const chunk of stdin) {
  10. result += chunk;
  11. }
  12. return result;
  13. };
  14. module.exports.buffer = async () => {
  15. const result = [];
  16. let length = 0;
  17. if (stdin.isTTY) {
  18. return Buffer.concat([]);
  19. }
  20. for await (const chunk of stdin) {
  21. result.push(chunk);
  22. length += chunk.length;
  23. }
  24. return Buffer.concat(result, length);
  25. };