{"action":"created","issue":{"url":"https://api.github.com/repos/arturadib/shelljs/issues/18","labels_url":"https://api.github.com/repos/arturadib/shelljs/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/arturadib/shelljs/issues/18/comments","events_url":"https://api.github.com/repos/arturadib/shelljs/issues/18/events","html_url":"https://github.com/arturadib/shelljs/issues/18","id":4999294,"number":18,"title":"how to read console input","user":{"login":"roofeel","id":1115454,"avatar_url":"https://avatars.githubusercontent.com/u/1115454?v=3","gravatar_id":"","url":"https://api.github.com/users/roofeel","html_url":"https://github.com/roofeel","followers_url":"https://api.github.com/users/roofeel/followers","following_url":"https://api.github.com/users/roofeel/following{/other_user}","gists_url":"https://api.github.com/users/roofeel/gists{/gist_id}","starred_url":"https://api.github.com/users/roofeel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roofeel/subscriptions","organizations_url":"https://api.github.com/users/roofeel/orgs","repos_url":"https://api.github.com/users/roofeel/repos","events_url":"https://api.github.com/users/roofeel/events{/privacy}","received_events_url":"https://api.github.com/users/roofeel/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/arturadib/shelljs/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2012-06-11T08:58:10Z","updated_at":"2015-01-13T21:50:52Z","closed_at":null,"body":"following code snipper works using 'node' command, but not works using 'sjs' command\n\n```javascript\nprocess.stdin.on('data', function (chunk) {\n  process.stdout.write('data: ' + chunk);\n}).resume();\n```"},"comment":{"url":"https://api.github.com/repos/arturadib/shelljs/issues/comments/69827325","html_url":"https://github.com/arturadib/shelljs/issues/18#issuecomment-69827325","issue_url":"https://api.github.com/repos/arturadib/shelljs/issues/18","id":69827325,"user":{"login":"tracker1","id":444316,"avatar_url":"https://avatars.githubusercontent.com/u/444316?v=3","gravatar_id":"","url":"https://api.github.com/users/tracker1","html_url":"https://github.com/tracker1","followers_url":"https://api.github.com/users/tracker1/followers","following_url":"https://api.github.com/users/tracker1/following{/other_user}","gists_url":"https://api.github.com/users/tracker1/gists{/gist_id}","starred_url":"https://api.github.com/users/tracker1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tracker1/subscriptions","organizations_url":"https://api.github.com/users/tracker1/orgs","repos_url":"https://api.github.com/users/tracker1/repos","events_url":"https://api.github.com/users/tracker1/events{/privacy}","received_events_url":"https://api.github.com/users/tracker1/received_events","type":"User","site_admin":false},"created_at":"2015-01-13T21:50:52Z","updated_at":"2015-01-13T21:50:52Z","body":"See [readline](https://www.npmjs.com/package/readline) or [readline-sync](https://www.npmjs.com/package/readline-sync)\r\n\r\n`readline-sync` defaults to stdio, for `readline` you'll need something like below...\r\n\r\n``js\r\n//readline\r\nvar readline = require('readline');\r\n\r\nvar rl = readline.createInterface({\r\n  input: process.stdin,\r\n  output: process.stdout,\r\n  terminal: false\r\n});\r\n\r\nrl.on('line', function (cmd) {\r\n  console.log('You just typed: '+cmd);\r\n});\r\n```"}}