I wondering the best way to handle this, and the best way to set modules up for child and parent relationships.
Using a filesystem as an example, say we have var myfs=require('FileSystem'); var file=myfs.createFile('test.txt'); file.write( 'data'); file.close();
Do we have a single module that contains both the FileSystem and File objects?
I want file to have a reference to it's parent, and have it's own methods.
Should this be set up as two modules, where Filesystem is a list of File objects?
I've not seen any modules that contain two or related classes.
@Wilberforce started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I wondering the best way to handle this, and the best way to set modules up for child and parent relationships.
Do we have a single module that contains both the FileSystem and File objects?
I want file to have a reference to it's parent, and have it's own methods.
Should this be set up as two modules, where Filesystem is a list of File objects?
I've not seen any modules that contain two or related classes.