roaring-wasm-papandreou
Version:
WebAssembly port of Roaring Bitmaps for NodeJS
34 lines (30 loc) • 791 B
JavaScript
/**
* The emcc module.
* @ignore
*/
class RoaringWasmModule {
constructor() {
this.noExitRuntime = true
}
}
function loadRoaringWasm() {
//const cwd = typeof process === 'object' && typeof process.cwd === 'function' && process.cwd()
const roaringWasmModule = require('./roaring-wasm-module')
const isNode =
typeof __dirname === 'string' &&
typeof process === 'object' &&
typeof process.versions === 'object' &&
process.versions.node !== undefined
const m = new RoaringWasmModule()
if (isNode) {
m.ENVIRONMENT = 'NODE'
}
if (typeof __dirname === 'string' && __dirname) {
m.locateFile = function locateFile(file) {
return `${__dirname}/${file}`
}
}
return roaringWasmModule(m)
}
module.exports = loadRoaringWasm()