Answers for "how to export a class in node js"

3

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);
	}
}
Posted by: Guest on October-04-2020
1

how to export a class in node js

class TestClass {
  
}

module.exports.TestClass = TestClass;
Posted by: Guest on February-05-2021
18

how to export module in node js

module.exports ={
 //functions
}
Posted by: Guest on May-30-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language