# @aeroware/classify.js

> Turn a string into a class!

Latest version **1.0.0** (published 2021-03-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install @aeroware/classify.js
pnpm add @aeroware/classify.js
yarn add @aeroware/classify.js
bun add @aeroware/classify.js
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-03-14 |
| First published | 2021-03-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | cursorspkg, dheerajpv |

## Links

- npm: https://www.npmjs.com/package/@aeroware/classify.js
- npm.io page: https://npm.io/package/@aeroware/classify.js

## Recent versions

- 1.0.0 (latest) — 2021-03-14

## README

# classify.js

Turn a string into a class!

The syntax of the format classify.js takes is very easy to learn.

The format goes something like this:

```
ClassName [constructor parameters]
    javascript code for the constructor

property = value

method [method parameters]
    javascript code for the method

...
```

classify.js will ignore anything that it can't understand.

Want a static property or method? Simply prefix the property or method with `+`. What about asynchronous methods? Prefix the method with `=`.

The `=` must go AFTER the `+` for it to work.

Parameters are separated by spaces inside the square brackets.

Here is an example using everything that was mentioned:

```js
classify`
Person [name age]
    this.name = name;
    this.age = age;

sayHi []
    console.log(this.name);

+people = [];

getOlder []
    this.age++;

+=fetchData []
    return fetch("a url");
`;
```

This will produce the following class:

```js
class Person {
    constructor (name age) {
        this.name = name;
        this.age = age;
    }

    sayHi () {
        console.log(this.name);
    }

    static people = [];

    getOlder () {
       this.age++;
    }

    static async fetchData () {
        return fetch("a url");
    }
}
```

---
_Source: https://npm.io/package/@aeroware/classify.js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
