synchronous global require function for the browser to load commonjs modules from a (relative) path, a URL or npm
https://www.npmjs.com/package/npm-require
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="src/npm-require.js"></script>
</head>
<body>
<script>
var minixhr = require('minixhr') // from npm
var pkg = require('./package.json')
var demo = require('./demo') // resolves to `./demo.js`
demo(pkg)
</script>
</body>
</html>
MIT