neonious / lowjs

A port of Node.JS with far lower system requirements. Community version for POSIX systems such as Linux, uClinux or Mac OS X.
http://www.lowjs.org/
Other
1.27k stars 72 forks source link

Missing 'global.require' (undefined) #115

Closed algj closed 3 years ago

algj commented 4 years ago

I wanted to replace require function to accept json files, but I noticed that global.require is undefined, but functions like global.console.log aren't, this is weird.

Same for Module.prototype.require, Module is undefined.

How do I replace require function?

ThomasRogg commented 4 years ago

require is currently defined per module.

But if you simply want to require JSON files, let me check what the problem with #114 (require JSON files) is this weekend and report!