<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Node.js on 答えを知りたい</title><link>https://hack.ironsand.net/tags/node.js/</link><description>Recent content in Node.js on 答えを知りたい</description><generator>Hugo -- 0.147.9</generator><language>en-US</language><lastBuildDate>Wed, 01 Nov 2017 06:28:12 +0000</lastBuildDate><atom:link href="https://hack.ironsand.net/tags/node.js/index.xml" rel="self" type="application/rss+xml"/><item><title>NodeJSのREPLでctrl+r で過去の履歴を検索</title><link>https://hack.ironsand.net/2017/search-history-in-nodejs-repl-by-ctrl-r/</link><pubDate>Wed, 01 Nov 2017 06:28:12 +0000</pubDate><guid>https://hack.ironsand.net/2017/search-history-in-nodejs-repl-by-ctrl-r/</guid><description>&lt;p>&lt;code>bash&lt;/code>やRubyの&lt;code>pry&lt;/code>で&lt;code>ctrl+r&lt;/code>で使える reverse interactive search を&lt;code>node&lt;/code>のシェルでも使う方法の紹介です。&lt;/p>
&lt;h3 id="rlwrap-のインストール">rlwrap のインストール&lt;/h3>
&lt;p>&lt;code>rlwrap&lt;/code>が必要なので&lt;code>brew install rlwrap&lt;/code>でインストールしましょう。他の環境の場合は環境にあったパッケージマネージャでインストールしてください。&lt;/p>
&lt;p>&lt;code>rlwrap&lt;/code>はGNUの&lt;code>readline&lt;/code>的な振る舞いをするためのパッケージだそうです。&lt;/p>
&lt;h3 id="node側の設定">node側の設定&lt;/h3>
&lt;pre class="lang:sh decode:true " title="~/.bashrc" >alias node="NODE_NO_READLINE=1 rlwrap node"&lt;/pre>
&lt;p>を追加して&lt;code>node&lt;/code>で&lt;code>readline&lt;/code>を使うように設定しておきましょう。&lt;/p>
&lt;h3 id="参考">参考&lt;/h3>
&lt;p>&lt;a href="https://stackoverflow.com/questions/46714331/how-to-use-reverse-interactive-search-in-nodejs-repl">https://stackoverflow.com/questions/46714331/how-to-use-reverse-interactive-search-in-nodejs-repl&lt;/a>&lt;/p></description></item></channel></rss>