browserfs-module
The Node.js' require()
on the browser!
Motivation
Browsers do not support the require()
API on Node.js, since they do not have File Systems. (And we are playing with magic require()
processors, like webpack).
But we can make fake File System on browsers by using BrowserFS.
Now, why not use the real require()
?
Install
npm:
npm install browserfs-module
bower:
bower install browserfs-module
Usage
node ./foo.js
corresponds to Module._load ('./foo.js')
.
You can use require()
in ./foo.js
just like on Node.js.
License
This is released under MIT License.