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.

example.js 945B

1234567891011121314151617181920212223242526272829303132333435
  1. var clarinet = require("clarinet")
  2. var parser = clarinet.parser();
  3. parser.onvalue = function (v) {
  4. console.log("Value: " + v);
  5. };
  6. parser.onkey = function (key) {
  7. console.log("Key: " + key);
  8. };
  9. parser.onopenobject = function (key) {
  10. console.log("New Object, first key: " + key);
  11. }
  12. parser.oncloseobject = function () {
  13. console.log("Close Object");
  14. }
  15. parser.onopenarray = function () {
  16. console.log("New Array");
  17. }
  18. parser.onclosearray = function () {
  19. console.log("Close Array");
  20. }
  21. parser.onend = function () {
  22. console.log('End');
  23. }
  24. parser
  25. .write('{ "firstName": "John", "lastName": ')
  26. .write('"Smith", "age" : 25, "address" : { ')
  27. .write('"streetAddress": "21 2nd Street", "')
  28. .write('city" : "New York", "state" : "NY",')
  29. .write('"postalCode" : "10021" }, "phoneNum')
  30. .write('ber": [ { "type" : "home", "number"')
  31. .write(': "212 555-1234" }, { "type" : "fax')
  32. .write('", "number": "646 555-4567" } ] }')
  33. .close();