Hello world setup for getting npm packages running the browser
JavaScript HTML
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.


Hello Browser NPM

This repo contains a simple comparison of how to run JavaScript the old way, with just including a script tag, to the new way, using npm modules and build tools.

View two sample web pages showing the "old way" and the "new way" here.

The Old Way


The New Way


New Way Hello World Quickstart


<h1>Simple Web Page</h1>
<script src=”simplebundle.js”></script>


var repeat = require(‘repeat-string’);
console.log(repeat(‘hey’, 100));
document.write(repeat(‘hey’, 10));

npm command

$ npm install repeat-string

watchify command

$ watchify main.js -o simplebundle.js