0.1.2 • Published 1 year ago

kilam v0.1.2

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

kilam.js

Kilam js is in alpha, with the focus on html templates. Frameworks like React and Vue give this ability. With the caviot of having to learn new syntax and work arounds. The goal of this framework is to give all the abilitys of these javascript tools with little or no new syntax. With this framework what you learned starting as a web devloper is enough let the framework do the rest.

How to get started

npm i kilam

Require package on main.js

const { KILAM } = require('kilam');

Import your favorite server package

Mine is express so the rest of the tutorial will be with express.

const express = require('express');
const PORT = process.env.PORT || 3000;
const { KILAM } = require('kilam');
const app = express();

// kilam object requires your root directory
const km = new KILAM(__dirname);

// km will return your routes.js path
// src is the name of your public directory
let hostMap = km.build('src');

// deploy app
const host = require(hostMap);
app.use('/', host);

app.listen(PORT, () => {
    console.log(`Host Blaster on: ${PORT}`);
})

Create your folder structure

That question is easy, once you set up the server. Just run the code, project will build its self if evrything done as above.

How to template your html

Head to your scr folder go to views click on kilam_index.html this is your root. write your html there. To add a new page, just create a new html file in the same directory.

Importing js and css files

On your html file just use

<:Import src="./defaults to your css or js folder" :>

Kilam will render your files togeather into one. Based on the order your imports are in. Saving the browser from making a bunch of requests.


Kilam already has some templates that preload on new projects, use those as a guide as well. To work the server look for info on your preferrd packege. Tips for devs this package was built with nodemon package in mind to rebuild projects on file changes.