<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tevfik Tümer</title>
    <description>The latest articles on DEV Community by Tevfik Tümer (@tevfik).</description>
    <link>https://dev.to/tevfik</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F930692%2F0a968cf1-188d-44f9-9d29-94b3fe98d30b.png</url>
      <title>DEV Community: Tevfik Tümer</title>
      <link>https://dev.to/tevfik</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tevfik"/>
    <language>en</language>
    <item>
      <title>Reading stdin per character in NodeJS (asyncConfirm)</title>
      <dc:creator>Tevfik Tümer</dc:creator>
      <pubDate>Thu, 22 Sep 2022 14:39:06 +0000</pubDate>
      <link>https://dev.to/tevfik/reading-stdin-per-character-in-nodejs-asyncconfirm-3h1n</link>
      <guid>https://dev.to/tevfik/reading-stdin-per-character-in-nodejs-asyncconfirm-3h1n</guid>
      <description>&lt;p&gt;I bumped into this problem while I was writing a simple confirmation function. Looking to the documentation, I could not find any helper function that allows me to read only a single character from stdin. Therefore, I build a simple asyncConfirm function that allows user to confirm based on user input.&lt;/p&gt;

&lt;p&gt;Here is the gist that contains the complete very basic example and a little description can be found below the example.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Basic idea behind my approach reading stdin with a specific limit(3 bytes) of buffer using Promises to allow async functionality. Based on giving yesOptions returns boolean false or true.&lt;/p&gt;

&lt;p&gt;The example is tested only in unix platforms. You might need to tweak it for other platforms.&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
