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.

createNodeWriter.js.flow 520B

12345678910111213141516171819202122
  1. // @flow
  2. import type {
  3. WriterType,
  4. } from '../types';
  5. const createBlockingWriter = (stream: stream$Writable): WriterType => {
  6. return {
  7. write: (message: string) => {
  8. stream.write(message + '\n');
  9. },
  10. };
  11. };
  12. export default (): WriterType => {
  13. // eslint-disable-next-line no-process-env
  14. const targetStream = (process.env.ROARR_STREAM || 'STDOUT').toUpperCase();
  15. const stream = targetStream.toUpperCase() === 'STDOUT' ? process.stdout : process.stderr;
  16. return createBlockingWriter(stream);
  17. };