1.0.6 • Published 1 year ago

molax v1.0.6

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Molax

Molax is a new fast framework, that compiles to a pure HTML file.

Example App.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()

Constructor Requirements:

Props {
    title: String, 
    style?: Path, // as string
    script?: Path // as string 
}

Usage: new App(Props)

Component Class:

Methods: setState(state: object), render() NOTE: Render method requires being extended with

class ComponentName extends Component {

Constructor Requirements:

Props { /** as required by component */ } Usage: new ComponentName(Props)

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago