npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

create-stratox

v1.1.0

Published

JavaScript template framework for the effortless creation of component, views and user interfaces (UI).

Downloads

105

Readme

Stratox.js - framework npm

Stratox.js is a user-friendly JavaScript framework that simplifies web application development. By focusing on core JavaScript and HTML, it empowers even beginners to efficiently build engaging projects. Its template engine and form builder follow HTML semantics, ensuring straightforward and accessible development. Stratox.js delivers optimal performance, swift response times, and seamless functionality across all devices, making it ideal for developing versatile web applications.

enter image description here

Documentation

You can find the full Startox documentation here

The documentation is divided into several sections:

You can find the full Startox documentation here

Installation

To install Stratox, simply execute the following command:

npm create stratox@latest

Next, follow the prompted instructions to complete the installation process. If you're a first-time user, I highly recommend reading through the entire guide.

The installation prompt will also offer to install examples. While you can choose to install them, the step-by-step guide will build something similar to the examples. It is better to install the examples alongside your current setup to switch between them and receive helpful hints.

Updating the framework

To update Stratox, use the following command:

npm update

This command will ensure that you have the latest version of the framework installed.

Quick preview

Below you can se a quick preview how to use the framework.

Create view

Let's begin by creating a dynamic template view file named src/templates/views/text.js. and add the following content to it.

export function text(data, container, helper, builder) {
	return `
	<article class="relative card-1 border-bottom ingress">
		<div class="wrapper md">
		    <h1 class="headline-1">${data.headline}</h1>
		    <p>${data.content}</p>
		</div>
	</article>
	`;
}

Create controller

Let's create a controller file named src/templates/Pages.js and add the following code to it. Incorporate your view into the controller and pass in template data such as headline and content.

import { text } from "@/templates/views/text";

export class Pages {

    start(request, container, helper, builder) {
        this.view(text, {
            headline: "Hello world!",
            content: "Lorem ipsum dolor",
        });
        return this;
    }
    
    about(request, container, helper, builder) {
        this.view(text, {
            headline: "About us",
            content: "Lorem ipsum dolor",
        });
        return this;
    }
}

Router

Now that we have created the controller, we need to establish a connection between it and the router. Let's open up the router example again and make the following changes:

First, add the import statement for the Pages controller at the top of the router file src/routes/app.js:

import { Pages } from '@/controllers/Pages';

Then, update the router routes for the start and about pages as follows, connecting your controller to each route:

router.get('/', [Pages, "start"]);
router.get('/about', [Pages, "about"]);

Resulting in

enter image description here