CrxOop CrxOop: Bringing Object Oriented Programming, and Proper Prototype Based Programming, To Javascript
The aim of the library documented below is to provide developers with a solution to allow development using interfaces and classes as they are known in other object oriented programming (OOP) languages such as C++, C#, Java and PHP. Further more, V1.4 introduces structures, a generalization of the concept of prototypal inheritance, known here as POBP.
Subject
Body*
Email
SUBMIT CLOSE
Menu

9.0 Node.js Usage

CrxOop V2.x gives explicit support to Node.js. You can use the npm package, "crx-oop", or simply download CrxOop and include it using 'require()'. The returned object from require will be what is refered to as 'crxOop' in this documentation. For example, "crxOop.isStructureInheriting" would be found on this returned object as "isStructureInheriting". Further more, the global functions, crx_new, crx_registerClass, crx_registerInterface, crx_registerStructure and crx_static, will also be found on this object.

If you wish to have the globals be globals like in the browser, set a 'window' object on 'global'. If CrxOop finds one, it will populate it like in the browser, including with the object 'crxOop'. Doing this will not change what is returned when calling require. That behavior remains the same.

Be careful with your own js files. Node.js does not guarantee executing a js file only once, and hence you must make sure that you do not register the same Class, Interface, or Structure more than once with CrxOop. See "crxOop.isClassRegistered" and "crxOop.isStructureRegistered".