<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>shinshin86</author_name>
  <author_url>https://blog.hatena.ne.jp/shinshin86/</author_url>
  <blog_title>at backyard</blog_title>
  <blog_url>https://shinshin86.hateblo.jp/</blog_url>
  <categories>
    <anon>Node.js</anon>
    <anon>stdin</anon>
    <anon>備忘録</anon>
  </categories>
  <description>Node.jsの標準入力で１文字ずつの入力に対して処理を発行したいケースがある場合のメモ。 stdin.setRawMode(true) にすることでキー入力に対してイベントを発行できるようになる。 (これをつけない場合、Enterキーが押された場合のみ on('data', () =&gt; ... が動くようになる) 実際にキー入力に対して処理を動かす際のサンプル。 なお、Ctrl + C と、Enterキー を押した場合のみプロセス終了などの処理を動かすようにしている。 // これをつけないとEnterキーが押されたときだけストリームを取得することになる process.stdin.setRa…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fshinshin86.hateblo.jp%2Fentry%2F2021%2F11%2F08%2F210000&quot; title=&quot;Node.jsの標準入力で１文字ずつの入力に対して処理を発行したいとき - at backyard&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2021-11-08 21:00:00</published>
  <title>Node.jsの標準入力で１文字ずつの入力に対して処理を発行したいとき</title>
  <type>rich</type>
  <url>https://shinshin86.hateblo.jp/entry/2021/11/08/210000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
