Dieses Repository beinhaltet HTML- und Javascript Code zur einer NotizenWebApp auf Basis von Web Storage. Zudem sind Mocha/Chai Tests im Browser enthalten. https://meinenotizen.netlify.app/
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.

pretty.js 807B

12345678910111213141516171819202122232425
  1. var inspect = require('util').inspect
  2. if(!module.parent) {
  3. var es = require('..') //load event-stream
  4. es.pipe( //pipe joins streams together
  5. process.openStdin(), //open stdin
  6. es.split(), //split stream to break on newlines
  7. es.map(function (data, callback) {//turn this async function into a stream
  8. var j
  9. try {
  10. j = JSON.parse(data) //try to parse input into json
  11. } catch (err) {
  12. return callback(null, data) //if it fails just pass it anyway
  13. }
  14. callback(null, inspect(j)) //render it nicely
  15. }),
  16. process.stdout // pipe it to stdout !
  17. )
  18. }
  19. // run this
  20. //
  21. // curl -sS registry.npmjs.org/event-stream | node pretty.js
  22. //