{"action":"created","issue":{"url":"https://api.github.com/repos/nodeschool/discussions/issues/1225","labels_url":"https://api.github.com/repos/nodeschool/discussions/issues/1225/labels{/name}","comments_url":"https://api.github.com/repos/nodeschool/discussions/issues/1225/comments","events_url":"https://api.github.com/repos/nodeschool/discussions/issues/1225/events","html_url":"https://github.com/nodeschool/discussions/issues/1225","id":88757143,"number":1225,"title":"Missing Something (Probably Obvious) in Node tExercise 3","user":{"login":"anonRegions","id":8366322,"avatar_url":"https://avatars.githubusercontent.com/u/8366322?v=3","gravatar_id":"","url":"https://api.github.com/users/anonRegions","html_url":"https://github.com/anonRegions","followers_url":"https://api.github.com/users/anonRegions/followers","following_url":"https://api.github.com/users/anonRegions/following{/other_user}","gists_url":"https://api.github.com/users/anonRegions/gists{/gist_id}","starred_url":"https://api.github.com/users/anonRegions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anonRegions/subscriptions","organizations_url":"https://api.github.com/users/anonRegions/orgs","repos_url":"https://api.github.com/users/anonRegions/repos","events_url":"https://api.github.com/users/anonRegions/events{/privacy}","received_events_url":"https://api.github.com/users/anonRegions/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-16T15:17:40Z","updated_at":"2015-06-16T15:26:15Z","closed_at":null,"body":""},"comment":{"url":"https://api.github.com/repos/nodeschool/discussions/issues/comments/112470101","html_url":"https://github.com/nodeschool/discussions/issues/1225#issuecomment-112470101","issue_url":"https://api.github.com/repos/nodeschool/discussions/issues/1225","id":112470101,"user":{"login":"anonRegions","id":8366322,"avatar_url":"https://avatars.githubusercontent.com/u/8366322?v=3","gravatar_id":"","url":"https://api.github.com/users/anonRegions","html_url":"https://github.com/anonRegions","followers_url":"https://api.github.com/users/anonRegions/followers","following_url":"https://api.github.com/users/anonRegions/following{/other_user}","gists_url":"https://api.github.com/users/anonRegions/gists{/gist_id}","starred_url":"https://api.github.com/users/anonRegions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anonRegions/subscriptions","organizations_url":"https://api.github.com/users/anonRegions/orgs","repos_url":"https://api.github.com/users/anonRegions/repos","events_url":"https://api.github.com/users/anonRegions/events{/privacy}","received_events_url":"https://api.github.com/users/anonRegions/received_events","type":"User","site_admin":false},"created_at":"2015-06-16T15:26:15Z","updated_at":"2015-06-16T15:26:15Z","body":"Wow--you got to me before I submitted it. Here's the scoop:\n\nThese are the instructions:\n\n\"Write a program that uses a single synchronous filesystem operation to\nread a file and\nprint the number of newlines (\\n) it contains to the console (stdout),\nsimilar to running\ncat file | wc -l.\"\n\nThis is my code:\n\n//load fs module from Node core library\nvar fs = require('fs');\n//read file, returning Buffer object containing file contents\nvar buf = fs.readFileSync('path');\n//convert Buffer object to string, splitting it into array of substrings\nvar str = buf.toString().split('\\n');\nvar countNewlines = function(str) {\nvar count = 0;\nfor(i = 0; i < str.length; i++) {\n//need if statement built around regex search for '\\n'?\ncount += i;\n}\nreturn count;\n};\nconsole.log(countNewlines(str));\n\nThis is the error message in my console (Windows):\n\n\"fs.js:438\n  return binding.open(pathModule._makeLong(path), stringToFlags(flags),\nmode);\n                 ^\nError: ENOENT, no such file or directory\n'C:\\Users\\Ethan\\OneDrive\\Documents\\Prog\nramming\\Languages\\JavaScript\\NodeSchool\\learnyounode\\path'\n    at Object.fs.openSync (fs.js:438:18)\n    at Object.fs.readFileSync (fs.js:289:15)\n    at Object.<anonymous>\n(C:\\Users\\Ethan\\OneDrive\\Documents\\Programming\\Languag\nes\\JavaScript\\NodeSchool\\learnyounode\\myFirstIO.js:8:14)\n    at Module._compile (module.js:456:26)\n    at Object.Module._extensions..js (module.js:474:10)\n    at Module.load (module.js:356:32)\n    at Function.Module._load (module.js:312:12)\n    at Function.Module.runMain (module.js:497:10)\n    at startup (node.js:119:16)\n    at node.js:906:3\"\n\nI don't know what this means; nor do I understand what I'm getting wrong\nbecause I've never written i/o stuff before & can't seem to output\nindividual stages of this to check my code as I go.\n\nPlease advise.\n"}}