<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>mojeld</author_name>
  <author_url>https://blog.hatena.ne.jp/mojeld/</author_url>
  <blog_title>Entoverse</blog_title>
  <blog_url>https://react.hateblo.jp/</blog_url>
  <categories>
    <anon>node.js</anon>
  </categories>
  <description>テキストファイルに文字列を書く fsモジュールを使うので、先にfsをrequire記述します。 const fs = require(&quot;fs&quot;); テキストファイルを上書きします。 非同期の場合 fs.writeFile('out.txt', &quot;文字列書き込み（writeFile）\n&quot;, (err, data) =&gt; { if(err) console.log(err) else console.log(&quot;writeFile ok&quot;) }) 同期の場合 fs.writeFileSync(&quot;out.txt&quot;, &quot;文字列書き込み（writeFileSync）\n&quot;) テキストファイルに文字列を追…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Freact.hateblo.jp%2Fentry%2Fnode_writeFile&quot; title=&quot;Node.js テキストファイルに文字列を追記 - Entoverse&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>https://cdn-ak.f.st-hatena.com/images/fotolife/m/mojeld/20191125/20191125134831.gif</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2019-11-25 13:50:18</published>
  <title>Node.js テキストファイルに文字列を追記</title>
  <type>rich</type>
  <url>https://react.hateblo.jp/entry/node_writeFile</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
