title: Invoking a node module from react component
body: <p>How do I use Node Modules for example 'lwip' in React component ? This is for an electron application.</p>
  
  <p>Updating the question with Code:</p>
  
  <ol>
  <li>This is the react component from which I am trying to invoke another .js file.</li>
  </ol>
  
  <p>button.js</p>
  
  <pre><code>import React from 'react';
  import ReactDOM from 'react-dom';
  import resize from '../../node-code/process';
  
  class Button extends React.Component{
  
      mess(){
          console.log('working');
          resize();
      }
  
      render(){
          return &lt;button id="imgButton" onClick={this.mess.bind(this)}&gt;Upload Image&lt;/button&gt;
      }
  }
  
  export default Button
  </code></pre>
  
  <ol start="2">
  <li>This is the other javascript file where I am trying to resize the image.</li>
  </ol>
  
  <p>process.js</p>
  
  <pre><code>var lwip = require('lwip');
  
  export default function(){
      var lwip = require('lwip');
      lwip.open('../../public/img/portrait.jpg', function(err, image){
  
  
      image.batch()
          .scale(0.75)          // scale to 75%
          .rotate(45, 'white')  // rotate 45degs clockwise (white fill)
          .crop(200, 200)       // crop a 200X200 square from center
          .blur(5)              // Gaussian blur with SD=5
          .writeFile('../../public/img/output.jpg', function(err){
  
          });
  
      });
  }
  </code></pre>