Why Browserify ?

If you are using main javascript libraries that is dependent on other javascript libraries, then one of the major problem is that they cannot be used in the browsers. Because the browsers do no have the require('module')  functionality to  import the dependent modules.

Does that mean you cannot use  such libraries in  your browser?

Well the solution to the problem exists with the Browserify, that bundles up all the dependencies into a single script such that it can then be used in the browser.

Install How to? 

npm install -g browserify

Use How to?

browserify bloomfilter/bloomfilter.js -o bundle-bloomfilter.js 

Now, you can include the script file in your browser as
<script src="bundle-bloomfilter.js" > </script >

Finally we are done. Happy bundling Js libraries with browserify.

Have a Great Day!. 🙂

Advertisements