export and use class in node code example
Example 1: how to export a class in node js
class TestClass {
}
module.exports.TestClass = TestClass;
Example 2: node js module export class
module.exports = class Person {
constructor(firstName, lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
display() {
console.log(this.firstName + " " + this.lastName);
}
}