@vivaxy/nib
v0.4.0
Published
Run Node.js modules in browser environment.
Downloads
10
Maintainers
Readme
NiB
Run Node.js modules in browser environment.
Install
yarn add @vivaxy/nib
or npm i @vivaxy/nib
Usage
<html>
<body>
<script src="https://unpkg.com/@vivaxy/nib/index.js"></script>
<script>
window.node.init({ base: '.', nodeBuiltInBase: 'https://unpkg.com/@vivaxy/nib', nodeModulesBase: 'https://unpkg.com' });
window.node.require('./index.js');
</script>
</body>
</html>
Options
base
: path from html to your commonjs modulenodeBuiltInBase
: path from html to@vivaxy/nib
nodeModulesBase
: path from html tonode_modules
In your ./index.js
you can now use require
and module.exports
!
See test and test source.