Title: doc/bug: repl.start() prompt doesn't default to '> ' · Issue #5385 · nodejs/node · GitHub
Open Graph Title: doc/bug: repl.start() prompt doesn't default to '> ' · Issue #5385 · nodejs/node
X Title: doc/bug: repl.start() prompt doesn't default to '> ' · Issue #5385 · nodejs/node
Description: Version: v5.7.0 Platform: Linux arch-desktop 4.4.1-2-ARCH #1 SMP PREEMPT Wed Feb 3 13:12:33 UTC 2016 x86_64 GNU/Linux Following the contents of ./doc/api/repl.markdown, lines 217-227, I put this in repl_test.js: const repl = require('rep...
Open Graph Description: Version: v5.7.0 Platform: Linux arch-desktop 4.4.1-2-ARCH #1 SMP PREEMPT Wed Feb 3 13:12:33 UTC 2016 x86_64 GNU/Linux Following the contents of ./doc/api/repl.markdown, lines 217-227, I put this in...
X Description: Version: v5.7.0 Platform: Linux arch-desktop 4.4.1-2-ARCH #1 SMP PREEMPT Wed Feb 3 13:12:33 UTC 2016 x86_64 GNU/Linux Following the contents of ./doc/api/repl.markdown, lines 217-227, I put this in...
Opengraph URL: https://github.com/nodejs/node/issues/5385
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"doc/bug: repl.start() prompt doesn't default to '\u003e '","articleBody":"- **Version**: v5.7.0\n- **Platform**: Linux arch-desktop 4.4.1-2-ARCH #1 SMP PREEMPT Wed Feb 3 13:12:33 UTC 2016 x86_64 GNU/Linux\n\nFollowing the contents of `./doc/api/repl.markdown`, lines 217-227, I put this in `repl_test.js`:\n\n```\nconst repl = require('repl');\n\nvar replServer = repl.start();\nreplServer.defineCommand('sayhello', {\n help: 'Say hello',\n action: function(name) {\n this.write(`Hello, ${name}!\\n`);\n this.displayPrompt();\n }\n});\n```\n\nRunning that, I get \n\n```\nrepl.js:198\n throw new Error('An options Object, or a prompt String are required');\n```\n\nOn line 252 of `./doc/api/repl.markdown`, it is noted that prompt should default to `\u003e` if an options object is passed in, but not what should happen if it is called without arguments.\n\nI took a look at `./lib/readline.js` and `./lib/repl.js` and the culprit for the code snippet failing (if the docs represent the intended functionality) is line 197-198 of `./lib/repl.js`.\n\nEither way, it seems to me that either the docs should be updated to reflect the code, or those lines in `./lib/repl.js` should be removed to make it fall back to an empty object and thus the default `\u003e` prompt. No PR submitted because I don't know which of the directions to go in.\n","author":{"url":"https://github.com/greg-js","@type":"Person","name":"greg-js"},"datePublished":"2016-02-23T14:15:12.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/5385/node/issues/5385"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1c487a4e-82e7-0432-c758-5ac08aa70b3a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B988:1BDC7:723D09:9D3F05:6A4DD1DC |
| html-safe-nonce | 1fd5285b40e65398dc781832e03381493766c40a67cea233742137e1d5b6902f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOTg4OjFCREM3OjcyM0QwOTo5RDNGMDU6NkE0REQxREMiLCJ2aXNpdG9yX2lkIjoiMjUxMzEwNDY2Nzk3OTY2NTg4NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | eaaed03f35d77aaec7adce941f15fd76950b8def2989b90fafaa530deca1f1e9 |
| hovercard-subject-tag | issue:135748254 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/5385/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b4e493eaba8c4a3d5c42e993d035a94cdf4e41577ac3b0aba7bf17df038603e5/nodejs/node/issues/5385 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b4e493eaba8c4a3d5c42e993d035a94cdf4e41577ac3b0aba7bf17df038603e5/nodejs/node/issues/5385 |
| og:image:alt | Version: v5.7.0 Platform: Linux arch-desktop 4.4.1-2-ARCH #1 SMP PREEMPT Wed Feb 3 13:12:33 UTC 2016 x86_64 GNU/Linux Following the contents of ./doc/api/repl.markdown, lines 217-227, I put this in... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | greg-js |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width