node-builtin-map

1.0.16 • Public • Published

node-builtin-map

Explicitly requires all built-in node modules and puts into a single object.

You may think this is a very pointless module, and given the abundance of pointless modules on npm, I wouldn't blame you for thinking it. However, there is once very specific thing you can do with this module that requires the module to be in npm (otherwise, I would not have published it).

WZRD.IN

wzrd.in is a CDN that bundles node modules with browserify, for use in a normal web browser. This module requires the built-in node modules and provides them in a single object, meaning you can include the bundled version of this module in the browser and have access to the full node.js standard library.

Example

<!DOCTYPE html>
<html>
	<head>
		<script type="application/javascript" src="https://wzrd.in/bundle/node-builtin-map"></script>
		<script type="application/javascript">
			// This module includes a "require" function so that you can use the built-in modules just as if you were in nodejs
			require = require('node-builtin-map').require;
		</script>
		<script type="application/javascript">
			const os = require('os');
			console.log(os.platform()); // prints "browser"
		</script>
	</head>
	<body>
	</body>
</html>

Readme

Keywords

none

Package Sidebar

Install

npm i node-builtin-map

Weekly Downloads

0

Version

1.0.16

License

ISC

Unpacked Size

942 kB

Total Files

4

Last publish

Collaborators

  • lufinkey