2.0.2 • Published 3 years ago

class-without-new v2.0.2

Weekly downloads
-
License
Unlicense
Repository
github
Last release
3 years ago

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)