# class-without-new

> wrap around an es6 class to call without 'new'

Latest version **2.0.2** (published 2021-08-31) · Unlicense license · 0 weekly downloads

## Install

```sh
npm install class-without-new
pnpm add class-without-new
yarn add class-without-new
bun add class-without-new
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2021-08-31 |
| First published | 2021-08-05 |
| Weekly downloads | 0 |
| License | Unlicense |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ohad Baehr |
| Maintainers | ohad1997 |
| Keywords | class-without-new, class without new, new, class |

## Links

- npm: https://www.npmjs.com/package/class-without-new
- Repository: https://github.com/OhadBaehr/class-without-new
- Homepage: https://github.com/OhadBaehr/class-without-new#readme
- Issues: https://github.com/OhadBaehr/class-without-new/issues
- npm.io page: https://npm.io/package/class-without-new

## Recent versions

- 2.0.2 (latest) — 2021-08-31
- 2.0.1 — 2021-08-31
- 2.0.0 — 2021-08-31
- 1.0.0 — 2021-08-05

## README

## USAGE
ES6:

```js
    import transpile from ('class-without-new')
```
        

Node:

  
```js
    const transpile= require('class-without-new')
```


Usage:

```js
    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)
```

---
_Source: https://npm.io/package/class-without-new · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
