Jst writing for build web page like PHP. All your Javascript codes runs in V8 engine. So, faster.
Now you can use variables and print this variables, require modules , own modules and another pages.
Clone this repository, build pages on www ( page.jst ) and enjoy!
<?jst
const title = "test page";
const content = "test content";
?>
<html>
<head>
<title><?jst
print(title);
?></title>
</head>
<body>
<?jst
print(content);
?>
<img src="/test.png" />
</body>
</html>
You can use POST, GET and HEADERS variables
<?jst
print(POST.name)
?>
<?jst
print(GET.name)
?>
<?jst
print(HEADERS.Authorization);
print(HEADERS["Content-Type"]);
?>
You can use MySQL. We are added mysql-promise package for MySQL support.
Example :
<?jst
const query = await mysql.query("SELECT * FROM test");
const [rows] = query;
for(let i=0; i < rows.length; i++){
print(rows[i].name);
}
?>
await require("./other-async-page.jst");
const moment = require("moment");
const data = "test data";
await require("./partial-page.jst", {data});
partial-page.jst
<?jst
print(data);
?>
You can use console
console.log("some console write");
Now just me :D. You can send me pull request for contibution.