@vivaxy/nib

0.4.0 • Public • Published

NiB

Run Node.js modules in browser environment.

NPM Version NPM Downloads MIT License Standard Version

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 module
  • nodeBuiltInBase: path from html to @vivaxy/nib
  • nodeModulesBase: path from html to node_modules

In your ./index.js you can now use require and module.exports!

See test and test source.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.4.0
    3
    • latest

Version History

Package Sidebar

Install

npm i @vivaxy/nib

Weekly Downloads

3

Version

0.4.0

License

MIT

Unpacked Size

21.9 kB

Total Files

18

Last publish

Collaborators

  • vivaxy