title: How do i call a function of node js in vanilla js?
body: <p>i have a node js function -</p>
  
  <pre><code>const BpmnModdle = require('bpmn-moddle')
  var bpmn = function () {
    var bm = new BpmnModdle()
    console.log(bm)
  }
  module.exports = bpmn
  </code></pre>
  
  <p>I want to call this function in pure vanilla js.</p>
  
  <p>What i have tried so far-
  i have created a fileData javascript file in which i have tried to call bpmn function</p>
  
  <p>fileData.js</p>
  
  <pre><code>function createData(xml, node) {
    var bp = bpmn();
    console.log(bp)
  }
  
  </code></pre>
  
  <p>i have tried to bundle both in webpack. Where my webpack config file is</p>
  
  <pre><code>module.exports = {
      entry: [
        './javascript/examples/editors/js/bpmn.js',
        './javascript/examples/editors/js/app.js',
        './javascript/examples/editors/js/deletes.js',    
        './javascript/examples/editors/js/fileData.js',
        './javascript/examples/editors/js/jsonData.js',
        './javascript/examples/editors/js/new.js',
        './javascript/examples/editors/js/open.js',
        './javascript/examples/editors/js/save.js',
        './javascript/examples/editors/js/saveas.js',
        './javascript/examples/editors/src/js/mxClient.js',
        './node_modules/bpmn-moddle/dist/index.js'
      ],
      output: {
        path: __dirname,
        publicPath: '/',
        filename: 'bundle.js'
      },
      module: {
        rules: [
          {
            test: /\.js$/,
            exclude: /node_modules/,
            use: {
              loader: "script-loader"
            }
          },
          {
            test: /\.css$/,
            use: [
              {
                loader: "style-loader"
              },
              {
                loader: "css-loader",
                options: {
                  modules: true,
                  importLoaders: 1,
                  localIdentName: "[name]_[local]_[hash:base64]",
                  sourceMap: true,
                  minimize: true
                }
              }
            ]
          }
        ]
      }
    };
  </code></pre>
  
  <p>I am unable to call this function in pure js and i am getting an error saying
  "bpmn is not defined".</p>