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

catapultjs

v1.0.0

Published

A tiny javascript framework for simple apps and static sites.

Downloads

1

Readme

Catapult

We introduce to you a tiny client side framework for micro site.

Author: makekings.net

Current Version: 1.0.0 download catapult-min-1.0.0.js

Visit the Docs page for more info

Image of Yaktocat

The problem

When you create a micro site for you bio or your git repository or even for a client who wants something simple you are wandering:

How can i split the views ?

how can i create the routers ?

You realize that you cannot do it on client side only so you set up a hole apache2 with mysql server and use CMS, just for a 5 page site.

It's good to use wordpress, drupal or something else but you lose money and speed which this this not good.

The solution

Catapult has the following features that help you to do build a site:

  • Mange your the routes
  • Load other HTML files
  • Passing variables from javascript to view
  • Control your views with handlebars

Catapult works on client side only so you don't need to install nothing

How to start (step by step)

  1. download the git repository.

    $ git clone https://github.com/makekings/catapult you can find the file /bin folder

    or

    download the last version from here

  2. insert the handlebars script in your index file before the catapult.

       <script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/2.0.0/handlebars.js"></script>
       <script src="./js/catapult.js"></script>
  3. create two html files with any content in

    • ./views/home.html
    • ./views/about.html
  4. Add the following div in you index.html body

       <div id="catapult"></div>
  5. initialize the routers

    Catapult.router.routesSetup([
        {
            hash: "#/",
            handler: function(route, load){
                load(
                    {/* pass params to view */},
                    function(){
                        console.log("home page is loaded");
                    }
                )
            },
            file: "./views/home.html"
        },
        {
            hash: "#/about",
            handler: function(route, load){
                load(
                   {/* pass params to view */},
                    function(){
                        console.log("about page is loaded")
                    }
                )
    
    
            },
            file: "./views/about.html"
        }
    
    ]);
  6. You are ready just change the url from #/ to #/about to see the changes or you can add this tiny menu in your index.html

       <ul>
           <li><a href="#/">Home</a></li>
           <li><a href="#/about">About</a></li>
       </ul>