React Js require 'fs'
<p>I have </p>

<pre><code>import fs from 'fs'
</code></pre>

<p>and in my package.json I have</p>

<p>Then I run the command</p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>&gt;  npm i fs
&gt;  fs@0.0.2 node_modules/fs</code></pre>
</div>
</div>
</p>

<p>next  in my React store I import 'fs' module</p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>import fs from 'fs'</code></pre>
</div>
</div>
</p>

<p>However when I try to use fs</p>

<p>I don't see methods except for constructor and a few other __methods.  I don't see the method createReadStream or any other file manipulation methods.</p>

<p>Does anybody know what is wrong?   (using Webpack) and can give more information upon request,  but I am getting this far...</p>

<p>ps:  why is it that I can npm i fs --save when I read on other posts that I do not have to do that (using node 5.5.0)</p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>import Reflux from 'reflux'
import AddItemActions from '../actions/AddItemActions'
import request from  'superagent-bluebird-promise'
import fs from 'fs'

var ImageStore = Reflux.createStore({
  init(){
    .
    .
    .
  },

  decryptImage(file) {
    var reader = new FileReader();
    var info = {}
    reader.onload = (output) =&gt; {
      debugger
      request.post("https://camfind.p.mashape.com/image_requests")
        .set("X-Mashape-Key", "KEY")
        .set("Content-Type", "application/x-www-form-urlencoded")
        .set("Accept", "application/json")
        .send({'focus': { 'x': 480}})
        .send({'focus': { 'y': 640}})
        .send({'image_request': {'altitude': 27.912109375}})
        .send({'image_request': {'language': "en"}})
        .send({'image_request': {'latitude': 35.8714220766008}})
        .send({'image_request': {'locale' : "en_US"}})
        .send({'image_request': {'longitude': 14.3583203002251}})
        .send({'image_request': {'image': fs.createReadStream("/path" + 'file.jpg')}})
        .then(function (result) {
          console.log(result.status, result.headers, result.body);
          this.info = result
        },
          function(error) {
            console.log(error);
        })
    }

    reader.readAsDataURL(file);
    return info
  },
  .
  .
  .
  .
})</code></pre>
</div>
</div>
</p>