Skip to main content
edited body
Source Link
Anton
  • 45
  • 1
  • 9

I want to export a class with static methods in a module, along with other functions. I'm trying to do

module.exports = { fun: function(){}, class: myClassMyClass } class MyClass { static get prop() { return 'property'; } } 

But it does not work. Is there a way to export class as part of module.exports object?

I want to export a class with static methods in a module, along with other functions. I'm trying to do

module.exports = { fun: function(){}, class: myClass } class MyClass { static get prop() { return 'property'; } } 

But it does not work. Is there a way to export class as part of module.exports object?

I want to export a class with static methods in a module, along with other functions. I'm trying to do

module.exports = { fun: function(){}, class: MyClass } class MyClass { static get prop() { return 'property'; } } 

But it does not work. Is there a way to export class as part of module.exports object?

edited body
Source Link
Anton
  • 45
  • 1
  • 9

Export a class in Node ES6module.exports = {}

I want to export a class with static methods in a module, along with other functions. I'm trying to do

module.exports = { fun: function(){}, class: myClass } class myClassMyClass { static get prop() { return 'property'; } } 

But it does not work. Is there a way to export class as part of module.exports object?

Export a class in Node ES6

I want to export a class with static methods in a module, along with other functions. I'm trying to do

module.exports = { fun: function(){}, class: myClass } class myClass { static get prop() { return 'property'; } } 

But it does not work. Is there a way to export class as part of module.exports object?

Export a class in Node module.exports = {}

I want to export a class with static methods in a module, along with other functions. I'm trying to do

module.exports = { fun: function(){}, class: myClass } class MyClass { static get prop() { return 'property'; } } 

But it does not work. Is there a way to export class as part of module.exports object?

Post Undeleted by Anton
Post Deleted by Anton
Source Link
Anton
  • 45
  • 1
  • 9

Export a class in Node ES6

I want to export a class with static methods in a module, along with other functions. I'm trying to do

module.exports = { fun: function(){}, class: myClass } class myClass { static get prop() { return 'property'; } } 

But it does not work. Is there a way to export class as part of module.exports object?