Thanks!
I actually just found the answer. You have to export your classes with names assigned:
module.exports = {Dog: Dog, Cat: Cat};
and then do this in your referencing code:
var Dog = require("animals").Dog; var Cat = require("animals").Cat;
var c = new Cat();
@MarcEvan 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.
Thanks!
I actually just found the answer. You have to export your classes with names assigned:
module.exports = {Dog: Dog, Cat: Cat};
and then do this in your referencing code:
var Dog = require("animals").Dog;
var Cat = require("animals").Cat;
var c = new Cat();