typescript module exports import code example
Example 1: module.exports equivalent typescript
exports["default"] = A; module.exports = exports["default"];
Example 2: module.exports in typescript
class Person {
private firstName: string;
private lastName: string;
constructor(firstName: string, lastName: string) {
this.firstName = firstName;
this.lastName = lastName;
}
public getFullName() {
return `${this.firstName} ${this.lastName}`;
}
}
export = Person;