1.3.0 • Published 6 years ago
npm-require v1.3.0
npm-require
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
demo
<!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>
license
MIT