I have a library in old style like this
function A() { }
A.prototype.hello = function (s) {
console.log(s);
}
module.exports = A;
Some application is using it like this
const {inherits} = require('util');
const A = require('./lib.js')
function B() {
A.call(this);
}
inherits(B,A);
const b = new B();
b.hello('test');
I want to use a new style in library without any changes in application
class A {
hello(s) {
console.log(s);
}
}
module.exports = A.constructor // ???????
Question: What do I need to add in the last line for correct work?