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.

number-readable.js 486B

123456789101112131415161718192021
  1. 'use strict';
  2. var util = require('util')
  3. , stream = require('stream')
  4. , Readable = stream.Readable
  5. module.exports = NumberReadable;
  6. util.inherits(NumberReadable, Readable);
  7. function NumberReadable (opts) {
  8. if (!(this instanceof NumberReadable)) return new NumberReadable(opts);
  9. Readable.call(this, opts);
  10. this.idx = 0;
  11. this.to = opts.to;
  12. }
  13. NumberReadable.prototype._read = function () {
  14. if (this.idx > this.to) return this.push(null);
  15. this.push('' + this.idx++);
  16. }