I'm trying to use Browserify so that I can use an npm package in the browser. The package I'm trying to use is this
I have a fcs.js file:
// Use a Node.js core library var FCS = require('fcs'); // What our module will return when require'd module.exports = function(FCS) { return FCS; }; And an index.js file:
var FCS = require('./fcs.js'); console.log('FCS IS '); console.log(FCS); I then ran:
browserify index.js > bundle.js And created an index.html file:
<html> <script src="bundle.js"></script> <script> var fcs = new FCS(); </script> </html> But I end up with the error:
Uncaught ReferenceError: FCS is not defined Maybe I'm not grasping the concept correctly. How can i use this package in the browser? Thanks.