class-without-new
v2.0.2
Published
wrap around an es6 class to call without 'new'
Downloads
8
Maintainers
Readme
USAGE
ES6:
import transpile from ('class-without-new')
Node:
const transpile= require('class-without-new')
Usage:
const Animal = transpile(class Animal {
static create() {
return new Animal
}
constructor() {
}
bla(){
return 2
}
get ha(){
return 3
}
})
const Monkey = transpile(class Monkey extends Animal {
static create() {
return new Monkey
}
constructor() {
super()
}
});
console.log(Monkey().ha)