0.0.9 • Published 3 years ago
@supernovajs/core v0.0.9
SupernovaJS ·
The SSR Microframework
Write a ssr high performance app with vanilla js and pure HTML.
Features
- SSR
- Lazy load images
- SASS compilation
- Easy Routing
Get Started
Download and install Supernova
npm i -g @supernovajs/core
Create your project
supernova create my-app
Run your project
cd my-app && npm run dev
Code examples
pages/hello/index.js
You have an async default exported function that returns an object with data property.
module.exports = async () => {
return {
data: {
meet: "Hello world!",
},
};
};
pages/hello/index.html
You can use data object from your index.js here to template your html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Supernova Hello World!</title>
<link
rel="stylesheet preload prefetch"
type="text/css"
as="style"
href="/static/{{cssFileName}}"
/>
<script
type="application/javascript"
src="/static/{{clientScriptFileName}}"
async
></script>
</head>
<body>
<p class="meeting">{{meet}}</p>
</body>
</html>
pages/hello/style.scss
.meeting {
font-weight: bolder;
}
Pro tip: You can change npm start script to run supernova start --port=8000 to run in port 8000 for example.
CLI
Start a dev server with hot reload
npm run dev
Start a production ready server
npm start
Generate page
npm run generate-page <name>
0.0.9
3 years ago
0.0.8
3 years ago
0.0.7
3 years ago
0.0.5
3 years ago
0.0.6
3 years ago
0.0.4
3 years ago
0.0.3
3 years ago
0.0.2
3 years ago
0.0.1
3 years ago
0.0.1-beta.3
3 years ago
0.0.1-beta.2
3 years ago
0.0.1-beta.1
3 years ago
0.0.1-beta.0
3 years ago