# molax

> Molax { App, Component }

Latest version **1.0.6** (published 2023-01-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install molax
pnpm add molax
yarn add molax
bun add molax
```

## 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.6 |
| Published | 2023-01-05 |
| First published | 2023-01-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 20.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mahir Molai |
| Maintainers | mtgsquad.dev |

## Links

- npm: https://www.npmjs.com/package/molax
- npm.io page: https://npm.io/package/molax

## Recent versions

- 1.0.6 (latest) — 2023-01-05
- 1.0.5 — 2023-01-05
- 1.0.4 — 2023-01-05
- 1.0.3 — 2023-01-05
- 1.0.2 — 2023-01-05
- 1.0.1 — 2023-01-05
- 1.0.0 — 2023-01-05

## README

# Molax
Molax is a new fast framework, that compiles to a pure HTML file.

Example App.js: 
```js
const { App, Component } = require("molax");

class AppComponent extends Component {
  render() {
    return `
      <div class="App">
        <h1>Hello, ${this.props.name}.</h1>
        <br/>
        <p>${this.state.message}</p>
        <br/>
        <i>${this.state.test}</i>
      </div>
    `;
  }
}

const app = new App({ title: "Molax", style: "./app.css" });
const component = new AppComponent({ name: "Molax" });
component.setState({
  message: "Welcome To Molax. Edit App.js to get started.",
  test: "*passed from state*"
});
app.addComponent(component);
app.renderToFile("./index.html");
```
## Classes
### App Class:
Methods: `addComponent(component: Component)`, `renderToFile(path: String)`, `render()`
<br>
#### <b>Constructor Requirements:</b>
```
Props {
    title: String, 
    style?: Path, // as string
    script?: Path // as string 
}
```
Usage: `new App(Props)`

### Component Class:
Methods: `setState(state: object)`, `render()`
<br>
**NOTE:** *Render method requires being extended with*
```js
class ComponentName extends Component {
```
#### <b>Constructor Requirements:</b>
`Props { /** as required by component */ }`
<br>
Usage: `new ComponentName(Props)`

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