URL loader and type converter.
This module made of WebModule.
<script src="<module-dir>/lib/WebModule.js"></script>
<script src="<module-dir>/lib/FileLoader.js"></script>
<script>
// load resource
FileLoader.loadString(URLString, function(string) { ... });
FileLoader.loadJSON(URLString, function(json) { ... });
FileLoader.loadBlob(URLString, function(blob) { ... });
FileLoader.loadArrayBuffer(URLString, function(arrayBuffer) { ... });
// convert BlobURLString|URLString|Blob|File|TypedArray|ArrayBuffer to ArrayBuffer
FileLoader.toArrayBuffer(source, function(arrayBuffer) { ... });
</script>
importScripts("<module-dir>lib/WebModule.js");
importScripts("<module-dir>lib/FileLoader.js");
require("<module-dir>lib/WebModule.js");
require("<module-dir>lib/FileLoader.js");