You are reading a single comment by @MarcEvan and its replies. Click here to read the full conversation.
  • 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();


Avatar for MarcEvan @MarcEvan started