title: How to convert node.js code to regular browser javascript?
body: <p>I don't know how to get a javascript file to work for web-browser functionalit, when it's coded as node.js.</p>
  
  <p>The code in question is from a github <a href="https://github.com/svk31/graphenejs-lib" rel="noreferrer">graphenejs-lib</a>. I want to convert this node.js code into js:</p>
  
  <pre><code>import {Apis} from "graphenejs-ws";
  var {ChainStore} = require("graphenejs-lib");
  Apis.instance("wss://bitshares.openledger.info/ws", true).init_promise.then((res) =&gt; {
      console.log("connected to:", res[0].network);
      ChainStore.init().then(() =&gt; {
          ChainStore.subscribe(updateState);
      });
  });
  let dynamicGlobal = null;
  function updateState(object) {
      dynamicGlobal = ChainStore.getObject("2.1.0");
      console.log("ChainStore object update\n", dynamicGlobal ? dynamicGlobal.toJS() : dynamicGlobal);
  }
  </code></pre>
  
  <p>There is another github from the same developer, <a href="https://github.com/svk31/steemjs-lib" rel="noreferrer">steemjs-lib</a>, that shows both the node.js use, and the browser use in the README default page.</p>
  
  <p>I don't know how to make graphenejs-lib into browser javascript, like the steemjs-lib has been made into a regular javascript working version.  I contact the dev, but have yet to receive a response.</p>
  
  <p>I figured other people actually know how to do what the dev did for steemjs-lib, and get the graphenejs-lib to work in a browser.</p>
  
  <p>Can you help me out? Thank you.</p>